How to implement random sampling with continuous variables?
One standard approach is to use inverse transform sampling: if $F$ is the cdf of the desired random variable and $U$ is uniformly distributed, then $F^{-1}(U)$ has the desired distribution.  There are more sophisticated methods for specific distributions; you can find references and links where you can learn more in the linked Wikipedia article.