Unit files live in /usr/lib/systemd/system/ (from packages) and /etc/systemd/system/ (local, takes precedence). A service unit has the sections [Unit] (description, dependencies), [Service] (start command, user, restart behaviour) and [Install] (when it is enabled at boot).
Do not edit package files directly, since updates overwrite them. systemctl edit service creates an override in /etc/systemd/system/service.service.d/ that contains only the changed values. After changes, run systemctl daemon-reload.
If a service does not start, systemctl status and journalctl -u show why. A service stuck in failed after several quick restarts has usually hit StartLimitBurst and needs systemctl reset-failed.
Example
systemctl cat nginx.service