Hello Alice,
Nice analysis job. I think you correctly identified your main mistakes. The most important is probably your underestimating his passed pawn : when you play 39.Rxg6?, you basically snatch an unimportant pawn, while letting his passer promote. So yes, you must first take care of your opponent's main threat by playing 39.Rd5 and you'll be fine.
In the opening stage, put your pawns in the center ! 4.d4 has the additional benefit of preventing him doing the same (4.d4! e5 5.Nf3!)
I tried to publish a reply with some moves and commentary Alice but sometimes it posts and other times it does not. That being said, the primary reason that this game was lost is that from move 14 forward after Black consolidated his position bringing his Knights back, all but 3 of his moves were aimed at your Kingside yet you failed to adequately attack the Queenside, ultimately being checked by the Rook on h1 for the pawn to promote. Both sides made mistakes yes, but in a game where both sides castle to opposite ends of the board, it is imperative to get an attack in before your opponent does. You had opportunities to win up until the 40th move at which point your initiative completely disappeared and Black proceeded to win shortly later.
This was the winning line I calculated at move 40 forward:
40. Rxg7 d3 41.Ne6 Re8 42. Nc5 d2 43. Kg3 Re3+ 44. Kg4 Re2 45. Kh4 Re4+ 46. Kh5 Re8 47. Rc2 Rh8+ 48. Kg5 Rb8 49. Nd7! Rd8 50. Rc7 Kb8 51. Nb6 1-0 in view of that Black has no checks and White delivers mate with 52. Rxb7#. From 40. Rg3, the game was over.
Still, you fought very well here and even were up a minor piece. I would suggest analyzing this game further and studying on attack on castled positons on opposite wings and then in the future, you will likely see more wins come. Simply put, continue with your plan to attack the King unless your opponents threat is worse than yours and make just enough moves to negate the threat then continue with your attack. For a great example, look at the Yugoslav Attack in the Sicilian Defense, Dragon Variation. This has to be one of the sharpest lines to play dealing with counterattacking as one misstep spells doom for that side.
Good luck in future games.