The same technique we have been studying can work well up close: your bishop or queen makes a capture on f7 or an equivalent square in front of the king. Since your capturing piece has protection the king must retreat, leaving it unable to defend itself and resulting in mate.
In this first example the queens are faced off against each other. White is at risk of QxQ, but in the meantime he pins Black’s queen and safely can take advantage of the situation by playing the check Bxf7. This has the same effect as the bishop moves examined a moment ago: it forces the king back to h8. The difference is just that instead of moving to the king’s diagonal the bishop already starts there, and uses its move to take out the pawn that had obstructed its path. For this to work the bishop needs protection against KxB; here the protection is of course supplied by White’s queen. After Black moves his king, his queen and the mating square on which it sits are loose. White plays QxQ#.