user21021: Assuming we're playing white and a bank rank mate is being threatened. Which one of the pawns (f, g, or h), in most cases, should be moved? Is there a general rule for this?

user25913: Adding to what @Annatar has already analyzed in-depth, you may see Grand master's saying never play f6/f3 (e.g. Ben Finegold), and take that as an unspoken rule. That is not the case. Those sayings do exist because those diagonals are often dangerous for the king(depends on the position and the existence of enemy bishop). Also, it becomes a meme :P So a little heads up to what you may see or you may have already seen, don't take those as a rule immediately.
Basically, you just have to be aware of dangerous diagonals, where the enemy can attack and the best pawn move will change accordingly.

user13433: Of course, the concrete position is always more important than general "rules". However, as some guidelines of what is typically played:

f2-f3: Rarely. It opens up a dangerous diagonal (a7-g1) and usually also the second rank (normally, the d- and e- pawns were moved early on). Even if Black can't mate directly, they can often at least kick White's king around.
f2-f4: Occasionally, to immediately counter-attack a Black center position on e5 (if the second rank can be covered through other means).
g2-g3: Occasionally. Also opens up a diagonal (a8-h1), but that can be okay if Black has no queen and light-squared bishop anymore to exploit it and/or if White can play their own light-squared bishop to this diagonal.
g2-g4 or h2-h4: Occasionally. Can make sense to grab space when there are few pieces left (the pawns get vulnerable to piece attacks) or sometimes even to launch a counter-attack on Black's king.
h2-h3: Statistically, probably the most played among the pawn moves. It creates the  smallest weaknesses on paper - but as can be seen from the many alternatives, it's by far not a move that should be played in all positions. Especially not if Black controls h2 with another piece, obviously.
No pawn move at all: The better the player, the more likely they are to try and parry the threat without actually moving pawns. Usually, moving flank pawns to open up a vital escape square for your king doesn't do anything else on the board (especially when moving to only the third rank) and can thus be seen as a waste of tempo (on top of creating structural weaknesses). Sometimes, that's a sacrifice you just have to make to prevent mate, but if there is another way (covering the checking square with a piece, blocking the way, etc.), it's often to prefer.


21021: <p>Assuming we're playing white and a bank rank mate is being threatened. Which one of the pawns (f, g, or h), in most cases, should be moved? Is there a general rule for this?</p>
 25913: <p>Adding to what @Annatar has already analyzed in-depth, you may see Grand master's saying never play f6/f3 (e.g. Ben Finegold), and take that as an unspoken rule. That is not the case. Those sayings do exist because those diagonals are often dangerous for the king(depends on the position and the existence of enemy bishop). Also, it becomes a meme :P So a little heads up to what you may see or you may have already seen, don't take those as a rule immediately.</p>
<p>Basically, you just have to be aware of dangerous diagonals, where the enemy can attack and the best pawn move will change accordingly.</p>
 13433: <p>Of course, the <strong>concrete position</strong> is always more important than general &quot;rules&quot;. However, as some guidelines of what is typically played:</p>
<ul>
<li><strong>f2-f3</strong>: Rarely. It opens up a dangerous diagonal (a7-g1) and usually also the second rank (normally, the d- and e- pawns were moved early on). Even if Black can't mate directly, they can often at least kick White's king around.</li>
<li><strong>f2-f4</strong>: Occasionally, to immediately counter-attack a Black center position on e5 (if the second rank can be covered through other means).</li>
<li><strong>g2-g3</strong>: Occasionally. Also opens up a diagonal (a8-h1), but that can be okay if Black has no queen and light-squared bishop anymore to exploit it and/or if White can play their own light-squared bishop to this diagonal.</li>
<li><strong>g2-g4 or h2-h4</strong>: Occasionally. Can make sense to grab space when there are few pieces left (the pawns get vulnerable to piece attacks) or sometimes even to launch a counter-attack on Black's king.</li>
<li><strong>h2-h3</strong>: Statistically, probably the most played among the pawn moves. It creates the  smallest weaknesses on paper - but as can be seen from the many alternatives, it's by far not a move that should be played in all positions. Especially not if Black controls h2 with another piece, obviously.</li>
<li><strong>No pawn move at all</strong>: The better the player, the more likely they are to try and parry the threat without actually moving pawns. Usually, moving flank pawns to open up a vital escape square for your king doesn't do anything else on the board (especially when moving to only the third rank) and can thus be seen as a waste of tempo (on top of creating structural weaknesses). Sometimes, that's a sacrifice you just have to make to prevent mate, but if there is another way (covering the checking square with a piece, blocking the way, etc.), it's often to prefer.</li>
</ul>
