Magikoopas are actually pretty easy to deal with. They will hover in place, fire a magical blast, and then teleport to a new location. The wind up for their magic blast is long enough that you can easily dash up to one and bop it on the head with a jump, or shoot it with your own ranged attacks if you have the right Power-Ups. If the Magikoopa escapes with teleports, it leaves behind a trail that shows exactly where they will appear next, meaning you can surprise them the moment they become vulnerable again.