Apple - macOS: Disconnect Wi-Fi without turning it off
You can press and hold the Option key when clicking on the Wi-Fi icon in the menu bar. This way, you'll be presented with the extended menu of options and there find the option to disconnect from the currently connected access point without forgetting it or turning off the Wi-Fi.
Clicking on Wi-Fi menu bar icon normally
Clicking on Wi-Fi menu bar icon while pressing and holding down the Option key
Other services dependant on Wi-Fi availability such as AirDrop would continue to work.
P.S.: Other access points and extended network information blurred.
If the goal is simply to ensure that you use the LAN when available, and wifi otherwise, then you don't need to disconnect the wifi at all.
Simply drag the Ethernet entry above the Wi-Fi entry in the Network pane of System Preferences, and it'll use the former when available. The wifi can remain connected, but it'll only be used for data when the LAN is disconnected.