The safest and only legal way to play Minecraft on the Nintendo Switch is to purchase it through official channels:

Buy a physical game cartridge from reputable stores like Best Buy or Amazon.

Distributing or downloading copyrighted material like games without authorization is illegal in many jurisdictions. Official Alternatives