There are many ways out there to manage a Linux service depending on the distribution you are using.
This mainly boils down to if your distribution uses systemd or init. Based on that, systemctl and service are two officially adopted service managers for controlling services.
Intrestingly, service command still works even for those distributions that have migrated to systemd and systemctl.
Lets take the example of restarting nginx service to see how this can be done.
Type the below commands in the terminal to restart nginx for the changes to take effect.
sudo service nginx restart
OR
sudo /etc/init.d/nginx restart
OR
sudo systmctl restart nginx