In my understanding the StreamDeck doesn’t have any functionality of its own but merely starting scripts run on the device it’s connected to.
As such, you should explore which scripts can be run on your Mac that will do the steps you need. And then explore how you’d like to trigger them.
Apple Script was the main thing used before, these days more turned into Shortcuts that can do flows but has Siri support which could be used as a trigger.
There’s also Automator in some versions of macOS. Underneath, it’s still Apple Script where you can control the Ui.
I found this short thread with an Apple Script that activates Sidecar. Perhaps you can use that as a starting point?
https://discussions.apple.com/thread/255104679