How do I run commands in HA?

At the command prompt of any Linux terminal. You can use the SSH and Web terminal add-on if you are using home assistant OS: Home Assistant Community Add-on: SSH & Web Terminal