Supposedly, canonical transformations are used to provide a general procedure to transform a Hamiltonian such that all coordinates in the new frame are cyclic. I have done the proofs and derivations, but during my course I didn't actually get any practice on finding the right canonical transformations or the generating functions, and I'm feeling sort of in a limbo state where I can prove all the theorems but I can't apply them.
For example, consider the Harmonic oscillator:
$$H=\frac{p^2}{2m} + \frac{1}{2}\omega^2q^2$$
Goldstein provides the following $F_1$ generating function: $$F_1(q,Q)=\frac{m\omega^2q^2}{2} \cot Q $$
under which the hamiltonian transforms to $$H=\omega P$$
via the $F_1$ transformation equations:
$$ \begin{align*} p&=\partial_q F_1 \\ P&=-\partial_Q F_1 \end{align*}$$
I understand where the transformation equations came from and the theory behind the formalism, but I don't understand how to construct a canonical transformation myself or choose a correct generating function ($F_1$ to $F_4$). Basically, it seems that everyone is just pulling them out of the void.
Can anyone provide a "recipe" to transform/solve these problems? Are they just a matter of trial and error? Divine intervention?