Setting an inputfield to inactive until a button activates it?

Hello, I’m very new to unity and am struggling with this. What I am trying to do is have an input field object’s .SetActive to be false until it is set true by the OnClick event from a button. After the user has pressed enter or unfocused the input field, I would like the .SetActive to be back to false. I know how to get a button to alter the status of the input field, I just don’t know how to set an input field inactive at the times when the button isn’t clicked since it is defaulted to being active. Thank you in advance to anyone who replies!

Ok I actually found a video that shows how to make the inputfield hidden by default. I’ll link it with a timestamp. Simple Text Input Field Window in Unity (Submit Score, Name) - YouTube
The inputfield is now hidden by default and will appear when I press a button. However, I still cannot figure out how to make it so it is hidden again once a different button is clicked/the user clicks somewhere else on the screen.

Maybe this will help you: How to detect click outside UI panel - Questions & Answers - Unity Discussions