Force template on page load

tell me where to refer to the function to be run once at the start of the page.

Exactly I mean to set a specific template so that every time you open the page always the same template loads without regard to what template was set up in the back.