Whether you want to learn from your own games or by watching other good players it helps to watch replays. It can be very helpful to watch a pro match when the race you play as wins. Then compare it to a match you lost and see what you could have done.
There are lots of ways to learn how to get better like looking up strategies, build orders, and general tips. But actually watching a strategic game like from Force Starcraft 2 Strategy can be beneficial.
Here are some tips when learning from your replays.
1) Keep an eye on your opponent. Watch what strategy he is going for, what he scouted, when he expanded, how he attacked, etc. Then ask yourself what you could have done to counter that. Maybe you did not scout an expo at the right time and you could have attacked but then it was too late as he got the economic advantage before you even knew it.
A lot of the time he will have scouted you and got all the information he needed to get the right counter. This is very common when facing Protoss because they like to get an early Observer into your base to get the information. Then once they see your army they will know what units to get. Like if you were Zerg going for Roaches they went from Gateway units to Immortals. Or if you were Terran with Marines and Marauders they teched to Colossi.
2) Compare your gameplay to a pro player. There are so many replays available on the web like on Team Liquid. They are there for a reason, to help you get better. Watch how they scout, how they attack, when they expand, and so on. Feel free to copy their style and apply it to your own. Make sure to watch in their vision as well by selecting them and pressing on the camera below the play button.
3) Be honest and thorough. Do not just fast forward the replay and assume you lost because of not keeping up with your economy. Break it down. Did you defend against an early attack? Did you take advantage of the Xel'naga towers to see when an attack was coming? Maybe you got supply blocked.
Do not be afraid to be critical. Admit that you are not the best player and observe what you could have done better. Pro players need to be like this to ruthlessly improve their gameplay. Watching your replays and replays of others will also help motivate you to play more games with a different mindset. Then if you lose again you can just go back and do the same. Improve your mistakes one game at a time.