Web Widget Best Practice

Hey Team,
I’ve wanted to create a few website widgets and install them on one of my sites,
I wanted to ask if there is a recommended location to install on a page or if we need to install as a script.
Header, body or?

Thanks for the Dubb.

Enjoy the day