What you're describing is this: https://en.wikipedia.org/wiki/Linear_congruential_generator, a pseudo-rng.
This type of algorithm is cyclic, you cannot go beyond a certain limit. Therefore, the set from which you pick your numbers is bound, not infinite. It also depends on the allocated bits used to represent a number (32 bits ==> 2^32 possibilities). If you use arbitrary precision, this issue is no more a bottleneck.
Back in the old days, randomness wasn't as necessary and mathematical models weren't as computer friendly as today. Nowadays, because of computer simulation (i.e. Monte Carlo-Method) and cryptography, quality random numbers became a must.
There are three classes of RNG (Random Number Generators):
1. Cryptographically secure random sequences or values
2. "Real" or "True" random number sequences
3. The rest
These classes are defined by the generation method and the target. For example, "real" random numbers can only be generated by hardware exploiting some unpredictable phenomenon (white noise, specific atoms count in an area, a sensor of some sort, ...): https://en.wikipedia.org/wiki/Hardware_random_number_generator.
(these can be used everywhere, mostly for cryptographic algorithms).
For crypto, I'll let you read this: https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator
Check out this algorithm: https://en.wikipedia.org/wiki/Blum_Blum_Shub, there's a link for a nice paper called About Random Bits.
When it comes to methods, there are many. For example, you can use the linux /dev/urandom to generate a file and stop there. Or, hash the file using sha256 or another algorithm and extract a pseudo-random amount of bits from the hash and combine them to build a value.
I would recommend reading the following article: https://www.2uo.de/myths-about-urandom/
Enjoy