Nicole discovered the key to the hidden garden and opened the door.
First identify the verbs.
Nicole discovered the key to the hidden garden and opened the door.
To find the direct object of <em>discovered</em>, ask <em>what</em> Nicole discovered, she discovered "the key". Note that "to the hidden garden" qualifies the key, so "the key to the hidden garden" could be the complete word group. You will find out when you click on it, either just "the key" or the complete word group.
To find the direct object of <em>opened</em>, ask <em>what</em> Nicole opened, she opened "the door".