If black's king goes to e3, stalemate.
If black goes to any other square, you take the pawn, draw.

Any other move you would have made would have lead to black promoting their pawn and winning.



One last challenge for you : https://streptococcus.neocities.org/draw/Challenge.html