Assuming you have array with text values pushed into it here.
On button pressed
.. set text to array.at(floor(random(0,array.width)))
random(0,array.width) generates a number that we sue to index the array. That number is between 0 and amount of values in the array.
The floor() around that rounds it down, so we can use it for indexing without going off boundaries.
The array.at() indexes the array at index defined inside the brackets.