I know how to use it for random numbers, but what about tables?
If you have a table with numeric indices and want to get a random element from the table,
local t={"a","b","c","d","e","f","g"} print(t[math.random(#t)])
writing math.random(#t)
will produce a random number from 1 to the length of the table.
If what you mean is that you want to generate a table of random numbers, you can set the indices of a table to a random number:
local t={} for i=1,10 do t[i]=math.random() end