Lock Home Assistant function

I would like to have a function blocked in my Home Assistant so that I first have to enter a PIN to e.g. to control the heating. The element should be hidden after 1 minute. How does it work? I’m not at all familiar with YAML