Consideration of 1. Qh7+ is obligatory; it’s a safe check with the queen, and such moves often force useful changes on the board. In this case it pushes Black’s king to f8. You see Black’s queen over on b7 and thus wonder whether any succession of checks you can give might produce a skewer. The natural next one would be 2. Qh8+, forcing Ke7. Now you imagine 3. Qxg7+, executing the skewer—and see that Black puts out the fire with NxQ. The problem is that the skewering square is guarded, so now you back up and think about pausing to take out the knight with 3. RxN. There is a little problem with that move, though, too. Since it’s not a check, it gives Black time to move his queen; and since White would have just cleared his rook from f3, Black would have a particularly attractive option: Qh1#, ending the game. It would be quite different if White’s RxN gave check and thus held on to the initiative. Ah, but RxN does do that if White plays it a move sooner when Black’s king still is on f8. It goes 1. Qh7+, Kf8; 2. RxN+, e6xR—and now the rest works fine: 3. Qh8+, Ke7; 4. Qxg7+, Kd8; 5. QxQ. (If Black replies to RxN by moving his king instead of recapturing, the sequence goes a little differently: White brings his rook into the act on f7 a couple of moves later; soon he uses it to pick up Black's queen, with an eventual forced mate.)
The position is a study in the value of working with checks at every turn. It also illustrates the importance of staying conscious of your opponent’s threats and the trouble that can arise if you give him an unforced move to play in the middle of a sequence you are planning. On a more visual note, this is a position where the possibility of a skewer should be evident to you fairly quickly just from the layout of the pieces—the Black king and queen arrayed like this, with White’s queen able to slip in behind the king. A possibility, not a certainty, of course; there are a hundred ways it could have failed if the surroundings were a little different—if White’s rook had been on e3 instead of f3, etc. But if you at least can see the idea early it will help direct your thinking along useful lines that may turn up the tactic.