How Do i Enable an Object and then Disable it?

Hey Guys, How do i make a object enable by pressing the E key and then making it disable by pressing the E key again please help thank you :)

One way to do it (I'm sure there are better)

Imagine a button for a door, for example's sake:

Button on a wall that has a child object of an empty gameObject, that's a trigger.

When the player presses e, he sends a message (that doesn't require a reciever) that says "useSomething". When the trigger receives said message, it then sends the required variable change (Boolean might work well; doors are only open or closed, typically).