Well, in the game in question it's just a tactical blunder, not some principled strategic error. Remember this pattern and don't do it again.
As for the endgames in general, starting with the basics is what I'd suggest. Understand how K+p vs K works, then look at endgames that convert to those endgames, and so on. It's a long journey.
Sorry if I’m posting a game incorrectly, not sure how to properly link it.
Check out this #chess game: fullforceRC vs dbstance1 - https://www.chess.com/live/game/100207338601