There are exemptions. The pin on the Knight is annoying and if you move your Queen to e8 or c8, the Bishop will just capture the Knight and ruin your pawn structure. So might as well push g5.
getting frustrated trying to learn from chess.com
Would be more grandmasters out there. Chess is a game to think and adapt to your opponents moves so there is no “general rule” that can be followed mechanically. In reality this response is just an excuse saying I have no idea why g5 is the best move because after white sacs the knight how do you defend your position from Qf3 and Qg3. It’s probably a 12 move sequence where there is only one move every move that doesn’t lose
I'm trying my best to improve using the game review to assess my losses, however I'm finding it contradictory at times to what I've read and viewed on YT etc. For example in the following position the review 'best move' is to push the pawn to g5 in front of my king, whereas everything else I see says that at my level the pawns in front of the king are best left untouched - which is correct in general?