I suggest to have a look at Wikipedia (see the link below). The information there answers your question pretty well in my opinion, also regarding the Rayleigh method.
The theorem describes a general procedure - on the basis of a proper identification of the relevant physical quantities. In the example of the pendulum discussed in the link, a further dimensionless quantity like the maximum swing angle changes the result of the theorem obtained for the limit of small angles. Thus, to apply the theorem requires a lot of physical insight.