A file named name.service is created inside /etc/systemd/system containing something like the following.

[Unit]
Description=Servicio de prueba
After=network.target network-online.target
Wants=network-online.target

[Service]
ExecStart=/ruta/al/script.sh

[Install]
WantedBy=multi-user.target

Once we have created the service definition, its dependencies and requirements, as well as the executable itself, we can activate it, deactivate it and check it as we do with any other service.

Enable the service

systemctl enable name

Disable the service

systemctl disable name

Check service

systemctl status name