Is there a guide on how to autostart programs from the shell?

if you have to run a autostart-script as root a systemd-service is your choice. you will create it and enable it once as root. after this activation it will run. please read carefully the links below:

https://wiki.archlinux.org/title/Systemd