Random number generation is typically a two step process: first generate a uniformly distributed value, then transform that value to have the desired distribution. The former is the hard part, but also the part more likely to have been done for you in a library. The latter is relatively easy in principle, though some distributions are hard to (efficiently) sample from.
Here are some posts on testing a uniform RNG.
Here’s a book chapter I wrote on testing the transformation of a uniform RNG into some other distribution.
A few posts on manipulating a random number generator.
And finally, a post on a cryptographically secure random number generator.