When should I play f3/f6? For context, I've been playing chess for around two years now, and my rating on Lichess is ~1850. 

When I first started playing, I learned a lot of heuristics for playing well, e.g. rooks are better than knights/bishops, castling is good (maybe better than you think, as a beginner), trade down when you're up in material. As I got better I started learning exceptions to these rules- a strong knight might be better than a passive rook, the king is better uncastled in the endgame, don't make "even trades" when they're not really even (e.g. if you have to make concessions to your pawn structure).

For all of these examples my intuition eventually caught up to the rules I was following blindly. To a beginner all rooks are better than all knights, because it's hard to judge when pieces are strong -- this instinct only came after watching many more in-depth analyses of games where one player sacrificed the exchange.

But there is one rule that I never learned to break, and that is "never play f3/f6" (at least when I'm castled kingside). To me it's clear why I shouldn't, sinc it
 often creates weaknesses in front of my king, and there have been many games in my past where pushing the f-pawn was the losing move. But it's never obvious when I should. For example, in some of my game analyses the engine says that f3/f6 was the best move, but I can't see the idea behind it. (When it's the only move to prevent getting mated or forked, it's a bit clearer, so I guess I'm asking about the positional ideas behind it.)

So, when should I play f3/f6? I'm specifically asking this without reference to any opening, as a rule of thumb akin to the ones I brought up above.

Note that it is also easier for me to move my f-pawn when it gives me another clear positional advantage. For example I might not mind the weaknesses that arise from capturing an e-pawn because I build a stronger center. This is a bit of a contradiction with the opening-agnostic viewpoint I'm trying to have, but I guess I am asking specifically about the case of "dry" positions with a lot of meandering and no clear path.
It's probably helpful to ask oneself why a move such as f3/f6 (moving forward, I will only consider f3, but it should work from black's perspective as well) would be useful in general. Why would I ever even consider making such a move? The very obvious reasons should be clear to most: if I want to reinforce/control/attack the squares e4 and/or g4, then of course the pawn move to f3 could be very useful. Another very obvious reason for making the move is of course the pawn being attacked.

For reasons a bit more subtle, the move could also prove useful if I for some reason wish to vacate the f2 square (for instance, to clear the h4-e1 diagonal for my dark-squared bishop if it were pushed back by a black pawn mass). Another subtle reason is that the move could be used in a pawn endgame in favour of the immediate f4 push for tempo-related reasons, or more generally to induce zugzwang.

I've now listed all good reasons for making the move that I've been able come up with. If you can think of another general scenario where specifically f3 is called for, feel free to suggest it; I'm having a difficult time coming up with any other good general reason to play the move.

Now for the fun part: Why would I not wish to play f3? This question is equally important to the first one if you want a good heuristic for when to play f3. The reasons for not playing the move that I can think of are the following:


It blocks the f3 square for the g1 knight. This is a major drawback of opening systems that make an early f3 push in the opening, see for instance the Sämisch system against the KID.
It begins opening up the a7-g1 diagonal. This is generally not great since white's king is often on g1, just waiting to be harrassed if this diagonal opens.
It weakens the control over the e3 square. This means that White's dark-squared bishop doesn't really have a safe haven on e3 anymore. This is a common way to lose as White in, say, the open Sicilian.
It blocks the d1-h5 diagonal for White's queen/light-squared bishop.
It creates a so-called "hook" for Black's pawns/pieces to attack in a potential kingside attack by Black.
It can be a waste of time if I'm in a pawn race (either literal pawn race in an endgame or a "pawn storm" race). Sometimes you can go ahead with the pawn push g2-g4 without even defending the square first; after all, if I'm aiming to use a pawn storm to soften up black's king on the kingside, removing the g pawn opens up the g-file for my rook. This last point is highlighted in many games in the open Sicilian, where White attacks Black's king on g8 while Black attacks White's king on b1; in these races, every tempo counts.


Again, if you can think of another good reason not to play f2-f3, then feel free to add it to the list. Know these reasons well, because some of them are not that immediately obvious why they are a big deal. For instance, giving up control over the e3 square may seem innocent enough, but in many cases it can be surprisingly detrimental to your position, especially if the position is not closed. Therefore you shouldn't make weakening moves such as f3 without a clear intention in mind.

While I haven't really heard the rule-of-thumb to "never play f3/f6", the above list of reasons not to play it seems like a good explanation as to why someone gave you that advice; most of the points I listed above are not easy for a beginner to fully appreciate, so it's simpler to just remember "don't play f3/f6" when you're still new to the game. After all, before you can break the rules, you have to understand them first.

Therefore, as you're now no longer a beginner (as indicated by your rating), I would propose this new and improved heuristic for the f3/f6 move:

Never play f3/f6 if the good reasons for playing it do not outweigh the negative side-effects of playing it.

As you can see, this advice would be pointless to give to a beginner, but for a player who is starting to learn things beyond the bare basics of positional chess it is much more suitable - after all, as you get stronger you will notice that every decision you make is a tradeoff between pros and cons of that decision. Even the obvious moves are decisions which are made easy by the fact that it's very clear what part of the pro/con list outweighs the other, but more difficult positional decisions may sometimes seem like a coin toss. In general, your chess ability is directly tied to how well you manage to accurately make up the list of pros and cons for given moves, and in the more difficult cases you will not be able to use the crutches that are commonly given to novice players to evaluate a decision with accuracy.