From what I've read on some modern Samsung TVs if they have a settings button on the remote long pressing that is a shortcut directly to the input selection.
Another option is if the remote has a mic button you can use that. This works pretty well on my several year old Samsung (most of the time [1]). I just press the button and say e.g., "HDMI 2". If I want to watch an OTA channel, say channel 4, I say "channel 4".
I don't know how well this works on the newest models because I believe they know have they own Alexa-like thing called Bixby handling this instead of something built specifically for TV voice control.
If you don't watch OTA TV another possibility is to enable HDMI-CEC for your devices. Then when you turn on or wake a device it can switch the TV input to that device (and turn the TV on if it is not on).
[1] Around a year ago they had a glitch that affected the voice commands on older TVs around the world. Most reports were for 2017 TV models. These TVs started only recognizing voice commands in Russian (and the feedback showing what you said was in Russian too).
For switching between HDMI 1 and HDMI 2 I was able to learn how to say those well enough in Russian for it to work by listening to Google Translate speak them in Russian. But no matter how many times I tried I was not able to learn how to say "channel 4" well enough in Russian. It worked if I let the TV listen to Google Translate speaking it, so the problem was my pronunciation rather than Google Translate not translating correctly.