For the timer:
[Unit]
Description=Do something daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timer.target
For the one-shot service:
[Unit]
Description=Restart service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl try-restart my_program.service