First, let me correct the terminology: proofs are invented, sought, thought up, surmised, but not solved. Problems are solved; and if a problem is to find a proof then finding a proof solves the problem.
This may appear as a vicious circle but it is certainly true that, in most circumstances, one needs some prior knowledge of the subject before there is a chance of coming up with a proof of an additional result. Proofs by definition are based on previous knowledge:https://www.cut-the-knot.org/WhatIs/WhatIsProof.shtml
So you learn something along with learning how to prove the components of that something, unless, of course, you want to acquire a method or a tool for handling practical problems without necessarily learning of the reason why those methods work. (There is nothing shameful about that approach. Great people used it - often of necessity, not being able to justify why they worked.)
There are many methods of proof, not all applicable in particular circumstances. Calculus proofs may in general employ techniques different from those in Number Theory, and vice versa.
On one hand, the more you know and the more experienced you are, the easier for you to find a method of proof that would work for a particular problems. On the other hand, just because the methods of proof differ between subjects it may not be very wise to learn generalities, but rather learn to prove while following a specific subject. So the following recommendations should be taken with a grain of salt.
One book you may want to read is G. Polya's classic "How to solve it?"
Next in line, are books by J. Mason and his collaborators
- Thinking Mathematically
- Developing Thinking in Algebra
- Developing Thinking in Geometry
You may also want to have a look at "Proof in Mathematics" by James Franklin and Albert Daoud.
As I implied before, all these presuppose some prior knowledge and thus may be difficult without experience (although all are elementary). So I would start with Polya's book as an outline, a guide for learning attitude and continue with specific subjects paying special attention to the methods of proof you come across. When you do, it is often extremely useful to try slight modifications in the conditions of the statement and see how to adapt the proof to the changed circumstances. This is really a very good approach to learning to prove.
As any knowledge acquisition, mastering math (learning to prove, in particular) is a process. There is a variety of online forums where you may look for free assistance with specific problems. This one is only an example. A systematic study may require some kind of monetary compensation.