How does white win this endgame?


White can only win if it's Black's move here.. if it's whites move, the it's going to end as a stalemate

If it's white turn, you play Kf7 so you have opposition and your king can't take your pawn since it will be always protected by the king (creating a red carpet for the pawn) and then finish the game with a queen endgame. If it's blackturn you do the same with white when black plays Kh8, but usually as black Kg8 is played, then you must keep opposition once again and play Kg6 and after black turns play either Kf7 or Kh7, one of them that is possible

Yes it is not easy, but moves can be found by the method of elimination, excluding those that are sure to stalemate

This is lesson number one (or maybe two) in elementary endings.
With a knight's pawn the king has to go to the other file to get rid of stalemate. So 1.Kf7 Kh8 2.Kg6 Kg8 3.Kh6 and the rest is easy stuff.

White can only win if it's Black's move here.. if it's whites move, the it's going to end as a stalemate
its mate in 16 according to stockfish.