amortized analysis of max heap
When doing amortized analysis with a potential function, the potential function appears out of nowhere.  One way to come up with a potential function is to try picking some function, and then see if the calculation goes through.  If that doesn't work, one can try adjusting the potential function to make the calculation go through.  Sometimes we might let $\Phi(\cdot)$ be a placeholder, see what properties it needs to have to make the proof go through, and then try to come up with a function that has those properties.

In other words -- there is not necessarily any systematic way to find a potential function that works.  You might need to use trial-and-error, or a lucky guess, or other methods.