How would I make a hide pet system?

First off, I am not asking directly for a script [an example script would help though…]
I know how to code myself and how to do certain functions!

What I am doing is simply asking how I’d make a button that hides pets, but I don’t 100% know how to go about it, I’ve had some ideas but I find that are probably inefficient or the wrong way to go about it.

If someone is kind enough to give me an idea how to do it, that would lovely! Again I don’t need a script, just some simple instructions such as;

1 - Step 1
2 - Step 2

However many steps it’d take or just simply write out a response!

Thank you in advance,