So the Rayleigh-Ritz variational method can be used to calculate the ground state energy of a quantum system. If $\phi(x)$ is a suitable (square integrable) and normalised function of the coordinates of a system, then we can set $$E(\phi) = \langle\phi\rvert H\lvert\phi\rangle$$ We can obtain an upper bound on the ground state energy by minimising $E(\phi)$, the lower the value that we get, the better the approximation. Now my question, how can one know that this method, when possible, gives us the exact value of the energy if we do not know that value beforehand. Is there a way to check that we got an exact answer or just an approximation, without knowing the exact value beforehand?
I am not aware of any theorem that can tell you how close you are to the ground state energy. However,the energy fluctuations $ \Delta^2 E=\langle \psi| H^2 |\psi \rangle - \langle \psi| H |\psi \rangle^2 $ can be used as criteria, if the correct ground state is guessed then $\Delta^2 E=0$.