This is a good topic to ask for strategic advice, because often the computer will show you a ?? at some random place, because some impossible line was holding still, but actually your step towards trouble was earlier.
I'll give my strategic pondering first and maybe later we can analyze concretely any position?..
So
- don't create a "hook"
- don't "give your address" (castling too early inviting an attack)
- don't chase pieces and lose time
- better to move only center pawns in the opening so you can castle both ways potentially
- a3 and h3 can be great moves in some openings... but they have to have a real concrete reason otherwise they are just slow.
I often have trouble dealing with pawn storms on my kingside like this. Any advice on what I could've done better? I felt like I was already losing at move 13.