How do I switch data used from SIM1 to SIM2?

Go to Settings > Network & internet > Internet, select the corresponding SIM card and enter the Mobile data settings to enable / close. You can choose to enable / disable mobile data.