How can I launch a command by opening an app?

Could someone please tell me how to insert a terminal command into an "application" so when the app is clicked/opened the command is launched?
Thank you so much for your help.
You might be able to use Automator on your mac to do this, depends on what command you actually want to do. Learn how to automate your Mac | iMore

Original thread: https://forums.imore.com/threads/how-can-i-launch-a-command-by-opening-an-app.356551/