should of just googled as others have said.... but here,Though this question was basically answered, to be completely clear:
To play on more than one Switch locally they both need to connect to a local WLAN. There is no Ad- hoc.
Note, if your phone can be a WiFi hotspot that works as a WLAN just as well for playing away from home.
Welcome to the work of hamachi for the switch
https://gbatemp.net/threads/zero-to-smashing-local-wireless-online-ldn_mitm-guide.526228/