If $U \sim \mathsf{Unif}(0,1)$ and if random variable $X$ has inverse CDF (quantile function) $F^{-1}_X(t),$ then a realization $u$ of $U$ produces a realization
$F^{-1}_X(u)$ of $X.$
For example, if $X \sim \mathsf{Exp}(1),$ then we have PDF $f_X(x) = e^{-x},$
CDF $F_X(x) = 1 - e^{-x},$ and quantile function $F_X^{-1}(t) = -\log(1-t),$
for $x > 0, 0 < t < 1).$ Thus if you generate a sample of size 10,000 from
$U \sim \mathsf{Unif}(0, 1),$ then $X = -\log(1 - U) \sim \mathsf{Exp}(1).$
This can be demonstrated in R statistical software as shown below. [In R,
runif
generates a sample from a uniform distribution and dexp
is an
exponential PDF.]
set.seed(917); u = runif(10^4); x = -log(1-u)
summary(u)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000243 0.280017 0.677848 0.981355 1.363933 7.717536
hist(x, prob=T, col="skyblue2")
curve(dexp(x), 0, 8, add=T, col="red", lwd=2, n = 10001)
In the figure below, the histogram shows the 10,000 simulated values $X$
and the curve is the density of $\mathsf{Exp}(1).$

This 'quantile method' works easily if the CDF of $X$ can be written in
closed form and then inverted to find the quantile function of $X.$
The idea can often be extended more widely by finding a rational approximation
of the CDF and inverting it.
In R, a random sample of size n
from a standard unform
distribution can be generated with rnorm(n)
which is (a few technical
details for optimization notwithstanding) essentially qnorm(runif(n))
, where
qnorm
uses Michael Wichura's rational approximation to the normal quantile
function. (The approximation is accurate to the degree that can be represented
by double precision arithmetic.)
set.seed(918); z = qnorm(runif(10^5))
summary(z)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-4.283920 -0.673689 0.004902 0.005624 0.683117 4.532156

An entirely different method, specific to normal distributions, is used by the
'Box-Muller transformation' which generates two standard normal variates from
two standard uniform ones. [One nice explanation is given in Wikipedia.]