Find private exponent in RSA
If you know the prime factors (p,q) of the modulus, then it would be easy to find the private exponent.
You'll proceed as follow:


Compute the Carmichael function $\lambda(n)=\operatorname{lcm}(p-1,q-1)=\frac{(p-1)\times(q-1)}{\operatorname{gcd}(p-1,q-1)}$
Choose a number e such that $\operatorname{gcd}(e,\lambda(n))=1$,
Apply the Extended Euclid Algorithm to compute the inverse of $d=\frac{1}{e}\bmod\lambda(n)$,    Cf Donald Knuth:Semi-Numerical Algorithms II (or any other reference book),


Then the public Key is $(n, e)$, while the private Key is $(n,d)$. This correspond to the straightforward parameters of RSA Keys.
You can also generate with a similar way, the parameters associated to the CRT algorithm with allow a substantial gain when executing Modular exponentiation with the private Key.
If required I could depicted it.