To add friends on your Nintendo Switch, you can use a "Friend Code," a Bluetooth connection, or add someone you've played with recently.
You can add friends in "Minecraft" through their Microsoft account's gamertag, regardless of which platform they use to play the game.