The high-level description of classical mechanics was formulated by Hamilton, who was starting from optics. He saw a mathematical analogy between the equations for light and the equations for mechanics. The principle of least time (Fermat's principle) for light became the principle of least action for mechanics.
But the principle of least time does not predict diffraction, just the geometric path of a light ray. It fails when the wavelength of the light is large compared to whatever it's interacting with.
At the time, the equations for mechanics were clearly failing for small systems. Here's where Schrodinger had his incredible insight: what if mechanics broke in the same way as optics? Could matter itself display a kind of "diffraction" when its "wavelength" was similar in size to the objects it was interacting with? Could this explain the success of de Broglie's work, which treated small particles like waves?
Guided by that, he was able to add "diffraction" to the equations of matter and come up with the Schrodinger equation.
It's worth reading the original paper if you have a physics background -- probably grad-level (just being realistic.) I've been wanting to write a blog post about this because the physics lore is something like "Schrodinger just made a really good guess" but that totally undersells the depth of his reasoning.