You cannot as such turn off the physical SIM card only.
You can however take out the physical SIM-card from the holder. The phone will still work, and you'll be able to use the eSIM to access carrier services.
If you haven't got an eSIM already, and you want the same carrier for the eSIM - please check your carrier's web site or support contact. Some times it is possible to transfer your subscription free of charge to an eSIM instead of a physical SIM - leaving the SIM-slot free to use for other carriers when travelling.
Not all carriers support eSIM yet though, so your mileage might vary!
If you really want to just turn off the physical SIM card without removing it from the phone, you could turn off and on the phone without entering the SIM PIN-code. The SIM card will not be active then (even though it is physically powered on). However, it will be annoying as the phone prompts you to enter the PIN-code when trying to make calls, etc.