1. What I saw in the closet left me speechless.
= subject
Here, the noun clause is <em>What I saw in the closet. </em>This clause is used as the subject of the sentence. So, you can replace the entire clause with one simple word - <em>he. </em>For example: <em>He left me speechless. </em>This way you can easily determine that the first word (or rather the entire clause in the example above) is the subject.
2. When I was six, I learned how to swim.
= direct object
The noun clause here is <em>How to swim. </em>Even though this may look like an adverbial clause, it is not because it has the function of a direct object (which only noun clauses can). You can easily determine that this is a direct object by asking the question - <em>what? </em>For example: <em>What did I learn when I was six? </em>And the answer is: <em>How to swim. </em>This way you know it is an object.
3. I was caught between what my conscience was telling me and what I wanted to do.
= object of a preposition
Here, the noun clauses are <em>What my conscience was telling me and what I wanted to do. </em>They are objects, but not regular objects (like in sentence 2 above). Given that they are located after the preposition <em>between, </em>they are called object of a preposition.
4. The scary movie I watched is what kept me awake that night.
= predicative nominative
Predicative nominative is a word, phrase, or an entire clause following a linking verb (such as to be, to seem, etc.). In the example above, the linking verb is <em>IS, </em>and the clause following it <em>What kept me awake that night </em>is the predicative nominative.