Need help : Restart Pi from HA Front End

Need help on code to restart the Pi from Home assitant. If possible want a button on the front end to re-start the Pi.

Write a script that calls the service hassio.host_reboot