Making my own action

I'm trying to understand the basics, first steam deck. I want a button, that when pressed runs a command, then changes the icon for another. Any tutorials out there for this?
Was this page helpful?