Learn basic endgames like KQ, then KRR, then KR etc. Then solve checkmates in 1 moves, then 2 moves, etc. This will store "patterns" in your brain. Chess is all about pattern, no matter what position, it is a pattern. You want to learn as many of those. They are pretty much tools that you acquire and then use when the time comes.
I just started playing chess this week and find that I'm decent in the beginning but am terrible at ending games, and always end up "dancing around the board" for a bout 20 turns before it either ties or ends in a loss. Are there any tips you can give for traps to look out for/set up and end the game quicker?