Hi there!
If you are referring to Minecraft for iPhone / iPad, you would need to purchase it again.
If you are referring to macOS, it's a bit more complicated. There are two different versions of Minecraft for desktop: Minecraft: Java Edition and Minecraft: Bedrock Edition. If you purchased and downloaded the Minecraft from the Microsoft Store, you have the bedrock edition, which is not compatible with macOS. However, it appears they now include the Java edition with your Bedrock purchase -- more information can be found here: https://help.minecraft.net/hc/en-us/articles/6657208607501-Minecraft-Java-Bedrock-Edition-for-PC-FAQ#
Java is arguably better, anyways! :)