Minecraft on consoles doesn't natively support custom servers. However, there are a couple of workarounds that you can use below.
Method 1: Change DNS Settings
Disclaimer: There is no provided DNS for Nintendo Switch (2) specifically. You can try one or both of the following below, but they may not work. Uses BedrockConnect.
Navigate to your console's settings and find the option to add custom DNS. If you don't know how to do this, you can search up steps depending on your console.
On Xbox: Change your primary DNS to 104.238.130.180 and secondary DNS to 8.8.8.8. On Playstation: Change your primary DNS to 45.55.68.52 and secondary DNS to 8.8.8.8.
Open Minecraft and navigate to the "Servers" tab.
Join Mineville. Once you load in, you'll be greeted with a server management menu (BedrockConnect).
Add a server or connect to one (connecting is one-time), then enter the IP Address as "legacybattle.enderman.cloud" and the port as "29997".
If this method doesn't work, or you aren't comfortable with changing DNS settings, then try Method 2.
Method 2: BedrockTogether app
On a phone or tablet, go to your app store and download "BedrockTogether".
Launch BedrockTogether and ensure that you allow the app to communicate with devices on your network.
Enter the IP Address "legacybattle.enderman.cloud" and Port "29997" and, if you wish to, add it as a favorite server.
Click "Watch Ad and Run".
After the ad is over, launch Minecraft and go to the "Worlds" tab. Join the LAN world saying "Join me!" Keep the app open!
After you see an ad pop up on the app and see that you are Locating Server, you can close out of the app. You'll connect to the server.
If both of these methods did not work, you can try searching up something else online.