You should make a plan like this opening (my chess teacher showed me this) Or if your good at bullet, for blitz I reccomend to play 3 min. games :)
Hope this helps,
Also, sometimes I watch the "top game" because you might learn somethings from the CM GM or any other top player.
You can not play Bc4 and 2 moves later, go to b5, it´s a waste of time. You should finish development, just d3 (or h3 if you fear the pin on g4), Be3 and so on. Also exchanging on c6 the bishop without any pressure helps black.
And a bit later on, the idea of e5 is good, but again, first improve your pieces, with moves like Rad1, Rae1 and then open up the position. You have more space than black, don´t exchange everything or you will lose your small advantage (as it happened).
In the endgame, moving pawns is a complicated matter, and what you were doing was creating some weakness in your structure, (he didn´t try anything anyway), but specially g4 I don´t think is a good move, with queens on, the kings are very weak. Your opponent made g5, which was also very bad, and you use it to checkmate him.
Idea for opening: In the Philidor's as here or double KP openings in general, as white you would usually aim to play d4.
Everything is fine until 6. Bb5 - slight waste of time. 6. d4 or 6. Re1 are both decent choices here, finishing development and addressing the centre.
7. Bxc6?! is not a good idea. It gives up the bishop pair for nothing, allowing black easy equality and a comfortable game.
12. e5 is a good idea, but try to prepare pawn breaks if you have some spare time. 12. Rad1 or Rfe1 are both possible to make the e5 push even stronger before playing it, developing your rooks.
I'm wondering if 21. Qd4 works. I think it's safe, the idea being to get your pieces into more centralised locations after the trades.
21...Rxd5 was stronger.
22. Qxc7 is better for white of course.
The endgame... I'm not sure if I should comment here as the ideas of when to push or not to push pawns are tricky (and I don't really fully get it either.) In general, especially in queen endgames, try not to push your pawns too quickly, as there's a fine line between advanced and overextended pawns. 24. c5, 26. a4 and 27. g4 are examples of pawn pushes that created weaknesses and should be avoided.
You could start here. I incorrectly remembered the title of the article as tactical ideas in the Phillidor defence. It is not up to date or complete, but should give you the basic knowledge needed to understand the Phillidor defense.
Thanks for the input qablo, Remellion, and especially aggressivesociopath (the link really helped me out).