How to automatically connect to a wiFi network and turn off 4g LTE
Usually, mobile data should be turned off automatically by the system when WiFi is connected. If you're sure it's mobile data which is on, you could try some automation tools to handle this, e.g. Tasker (Condition: WiFi connected, Task: mobile data off), or Llama - Location Profiles (here I don't know the steps, but it can do that as well).