You can catch any of the three iterations, Magby, Magmar, or Magmortar, or you can catch and evolve a Magmar into Magmortar.
How to Evolve a Magmar into Magmortar?
In order to get Magmortar, you must trade Magmar while holding a Magmarizer. This was an item that, in previous generations, wild Magmars would be holding when caught. This time around, to find the special evolution item, Magmarizer, you’ll need to explore the Crown Tundra. Find an area named Tunnel to the Top. The Magmarizer is in this area on one of the cliff paths that connect the upper and lower areas together. It’s in the area with the wandering Salamence, in the corner of the room.
Catching Magmortar in the Wild
If you cannot trade, you can find Magmortar in the wild as well. It’s much rarer than the Magby and Magmar, and it would be easier to just get the Magmarizer, but if that isn’t an option, try catching Magmortar in the wild. You’ll need the weather to be “Intense Sun” and to search Ballimere Lake, Giant’s Bed, Frigid Sea, Snowslide Slope, and Slippery Slope within the Crown Tundra for your chance at catching Magmortar in the wilds.