The Schrodinger in his works uses the analogy of ray-optics being useless when the wavelength of light is comparable to the things it encounter as it starts interference or diffraction which can't be understood using ray-optics, similarly he pointed out that macro-mechanics (being equivalent to ray optics) can't work when things become small.
Consider a configuration space and lagrangian $L$. The Hamiltonian function of action is
$$ W=\int_{t_0}^t L\ dt \ \tag{1}$$
and we know,
$$ \frac{\partial W}{\partial t} + H = 0 \tag{2}$$
Which can be written as
$$ \frac{\partial W}{\partial t} + \frac{1}{2m}\left(\frac{\partial W}{\partial x_i}\right)^2 + V(x_i) = 0 \tag{3}$$
Where $x_i$ are generalized coordinates and $p_i = \frac{\partial W}{\partial x_i}$
We solve it by considering $$W=-Et +S(x_i) \tag{4}$$
Equation 3 becomes
$$ \vert \text{grad}W\vert = \sqrt{2m(E-V)} \tag{5}$$
Its geometric interpretation is as follows
Assume $t$ is constant, any function $W$ of space alone can be described by system of surfaces over which the $W$ is constant, choose an arbitrary surface with value say $W_0$ and the solution of equation 5 can be constructed out of initial arbitrarily chosen condition, by simply extending normal at every point say
$$ dn= \frac{dW_0}{\sqrt{2m(E-V)}} \tag{6}$$
The points on first surface will lead us to second surface with value $W= W_0 +dW_0$. Continuing it will lead to the whole system.
Now if we vary time the constant value of the surface will vary with velocity
$$ u=\frac{E}{\sqrt{2m(E-V)}} \tag{7} $$
Now instead of thinking the value is varying from surface to surface, one can imagine that the surface with constant value is varying in space, Which look like surface traveling like stationary waves in a medium (Huygen's principle), and the velocity given above will become the normal velocity of surface,
So now let's consider this wave system described by a wave-function
$$\psi =A(x_i)\sin{\left(\frac{W}{K}\right)}\tag{8}$$
$$\psi =A(x_i)\sin{\left(\frac{-Et+S(x_i)}{K}\right)} \tag{9}$$
Which leads to
$$\nu = \frac{E}{2πK} \tag{10}$$
Now $K$ is considered as universal constant as it does not depends on nature of mechanical systems and set it as $\hbar$ giving us
$$ h\nu=E \tag{11}$$
Which is an established relationship,
The wave-function should also satisfy wave equation
$$u^2\nabla^2\psi - \ddot\psi=0\tag{12}$$$$u^2\nabla_{x_i}^2\psi - \ddot\psi=0\tag{12}$$
Since frequency is known the wave-function depends on time only through factor $e^{\pm itE/\hbar}$
And $$\ddot\psi=-\left(\frac{E}{\hbar}\right)^2\psi \tag{13}$$
From equation 7,12 and 13
$$\nabla^2\psi + \frac{2m(E-V)\psi}{\hbar^2}=0\tag{14}$$$$\nabla_{x_i}^2\psi + \frac{2m(E-V)\psi}{\hbar^2}=0\tag{14}$$
Which is the famous Schrodinger equation,
The phase of these waves that are in configuration space is given by the action.