We call it pattern recognition. It's placement of the pieces that allow the tactic (checkmate in this case) to be possible. You take a set (hundreds) of very common checkmates in one and do them enough times to be able to recognize them in an instant. Then you take a set of very common checkmates (hundreds) in two and do them enough times to get them completely internalized. From there on it's easy to move up to mates in 3, 4, 5 etc. as you know all common mating patterns.
Best of luck,
Coach Kestony
For example, this guy: (https://m.youtube.com/watch?v=KDPXaL9V7hY) keeps on calculating checkmates in 4 and stuff. My checkmating strategy on the other hand is to keep on checking with multiple pieces until i get lucky, except for some obvious backrank mates and checkmates in one. How to learn the art of calculating a checkmate?