f2 and f7 are common weak squares against the king. Attacks like this are common. Usually you can prevent them by just watching those squares. For example 7. O-O just castled out of the danger as the rook would then be on f1. In this exact position, 7. h3! is more advanced because it practically dares them to play 7...Nxf2 but then 8. Rf1! and their knight is trapped!
A different problem you had in this game was your opponent misplacing their queen on literally move 2! Your 6th move Bg5 is logical, but not best. This video of mine should help you with this situation:
https://www.chess.com/game/live/116550626677I keep losing to this CONSTANTLY. I always feel defenseless. I can't even punish the early queen because it's not in range. I'm getting pissed off. I try my best to see any defenses to give myself an advantage but I simply CANT STOP THE ATTACK.