Subject: What I had forgotten was that I had a test today.
Direct object: You must choose which flavor of ice cream you want.
Indirect object: I will tell whoever will listen my frightening story.
Object of a preposition: Josie is not interested in whatever Kyle says.
Subject complement: Michael's excuse was that he had forgotten to set his alarm.
Appositive: It seems to bother the teacher that all the students are being too quiet.
(That the students are being too quiet seems to bother the teacher. Note that the appositive renames It, but does not follow immediately like other appositives.)
It can also be used as an adverbial noun (a.k.a. an adverbial objective or adjective complement), which is a noun that acts like an adverb modifying a verb, an adjective, or an adverb.
I'm afraid that we don't carry that ice cream flavor any longer. (The dependent clause modifies the predicate adjective afraid.)
Noun clauses often begin with pronouns, subordinating conjunctions, or other words. The introductory word generally has a grammatical function in the sentence.
Relative pronouns: that, which, who, whom, whose, what
Indefinite relative pronouns: whoever, whomever, whatever, whichever, whether, if
Interrogative pronoun: who
Interrogative adjective: what
Interrogative adverb: how
Subordinating conjunctions: how, if, when, whenever, where, whether, why
Whoever is responsible for this mess needs to clean it up. (Whoever is the subject of the verb is responsible.)
Whomever you hit accidentally deserves an apology. (Whomever is the direct object of the verb hit.)
Daria told me she was going to be late.
Daria told me (that) she was going to be late.
Some noun clauses, especially those used as subjects, begin with that, which seems to serve no function. It makes sense if you include the fact or the idea before it. Some modern English constructions that seem to make no sense are the result of our dropping words.
That we were late to class really upset the teacher.
The fact that we were late to class really upset the teacher.
Question clauses - In a noun clause, even if the main clause is a question, the dependent clause is written as a declarative.
Where is your father?
Do you know where your father is?
Not: Do you know where is your father?
When did you assign that?
We all asked when you assigned that.
Not: We all asked when did you assign that. (Unless the noun clause is in quotation marks.)