https://www.chess.com/forum/view/general/when-to-push-the-f-pawn
closed center, both sides castled King side, f4 by W, good or bad?
I don't think there is anything on that thread that is useful to the OP.
@OP - I'll try to do you a favor by posting my uneducated opinion in the hope that a higher rated player will see it and cringe just enough to stay long enough to correct me.
If you're castled Queenside, play f4. If you're castled Kingside, play b4. Very general of course and certainly far from foolproof.
Come on you better players. Correct me. Give some detail too. It's a good question. It deserves a good answer.
The thematic play is when the center is closed, look for an advantage on a wing. The f4 or ...f5 push is often related to this. If castled and somewhat developed the push can be a key move as seen in the Kings Indian Defense for black or Sicilian Closed for white.
Then the question is how to proceed after the f pawn push if opponent doesn't take. Take on e or push for bind? The bind is usually a forerunner to some sort of kside attack. Also the holes resulting from the push is a consideration as in e6 hole for black in some variations of the KID defense.
Maybe check out games played with the Bayonet Attack in the KID and Spassky -Geller Closed Sicilian games for closed center wing attack examples.
Thanks
Nikhil