Figure 6.2.2.9[White to move]

White can’t quite mate with his queen on g7 because although his knight attacks the square, Black’s knight defends it. Any other ideas? The open state of the long dark diagonal should catch your attention, even though the path of White’s bishop to h8 is blocked by his own rook—for perhaps the rook can be evacuated. Meanwhile White would need to pair the bishop with an attack down the h-file. He has his queen there already, but since the file is closed he really needs two heavy pieces: one to sacrifice on h7 and another to follow up and drop to h8. Conceivably the rook on e5 could do the job, especially since White needs to move it anyway to clear the bishop’s path. So then the next obstacle is the knight on f5, which obstructs the rook’s path to h5. But we know how to remove our pieces when they get in our own way: with a threat, and preferably with check. White thus can start Ne7+. This forces QxN (Kh8 allows White to mate with QxRf8); and now White has gotten his knight out of the way. Next comes the sacrifice Qxh7+ to open the file, and Black has to reply KxQ. Now White finishes Black off with Rh5+, giving check and uncovering his bishop’s attack down the long diagonal—and doing it safely because the Black pawn on g6 now is pinned. Black moves his king to g8 and White mates with his rook on h8.

Study the train of thought in this position with some care. It nicely shows how to work backwards to build a mating sequence. You start with an idea, then consider methodically about how to remove the obstacles to it. Here the germ of the idea was provided by the movement of Black’s g-pawn and the open dark diagonal that resulted. From there you look for ways to attack with two pieces on the h-file, and the rest is engineering. The pin of the g6 pawn at the end is easy to overlook if you haven't seen it before, but now you know to ask whether the king's movements in this sort of case might cause a pawn nearby to become unexpectedly paralyzed.