Go to the Automation Editor and create a new automation
In the top right corner you will see 3 dots which will open a menu, select “Edit in YAML” and paste in the automation from above. Make sure to change the entity IDs for the humidity sensor and smart socket to match those of your devices. Press “Save”
What do you mean by “template boxes”?
In the meantime… make sure you read:
Getting Started Automating
Understanding Automation Basics
How to Help Us Help You