Remember, there are two types of questions: yes-no and open-ended. A yes-no question can have only yes or no as the answer: "Are you cooking? - Yes, I am". An open-ended question can have many answers: "What are you cooking? - An egg".
'What' is one of the interrogative words we use to form an open-ended question. Other interrogative words include: 'who', 'why', 'where', 'when', and 'how'.
To ask for the name or identity of something, use What + verb 'be'+ subject:
- What is your name?
- What is the time?
- What was that?
To ask for the name of an action, use What + helping verb 'be'/'do' + subject + main verb:
- What do you do? (= as your job)
- What are you doing?
- What did you do?
You can also use a modal verb instead of a helping verb:
You can use 'what' in what phrases by putting it before other words: what time, what place, what color, etc.
- What time is it? - It's 5 o'clock.
- What day of the week is it? - It's Friday.
- What color was his shirt? - It was yellow.
What as a subject pronoun
When 'what' is the subject of a sentence, it works like any other subject pronoun (he, she, it, they).
- It fell off the wall.
- → What fell off the wall? ('What' replaces subject pronoun 'it')