To use the key, you must have it in your active inventory slot. Stand in front of a door with a yellow lock and use the primary interaction button (left mouse button by default) to unlock it. Once a lock is opened, the key typically has no further use and can be discarded to free up inventory space.
The Gold Key can be found in several locations throughout the game. Here are some of the most common locations: hello neighbor gold key