Let $f(x) = x^3-x^2+2x+8$, and $K = \mathbb{Q}[x]/(f(x))$.
Using PARI/GP, I knew that the prime $(2)$ is factored into $3$ prime ideals in $K$ as $(2) = P_A P_B P_C$, where
$P_A=(2,x^2/2-x/2)$
$P_B=(2,x^2/2+x/2+3)$
$P_C=(2,x+3)$
According to the website https://www.lmfdb.org/NumberField/3.1.503.1 the class number of $K$ is $1$ so every ideal is principal. So, how to obtain the generator of $P_A, P_B, P_C$? Is there some command available in PARI/GP?
You can do this in Sage via the following code. You can use the online calculator if you don't have Sage on your computer.
In fact, the following code will give you the factorization of $(2)$ into principal ideals: