As a relative pronoun what means ‘the things which.’ It does not refer to a noun that comes before it.
- What she said made me cry. (Here what and its clause act as the subject of the verb made.)
- We can’t give you what you need. (Here what and its clause act as the object of the verb give.)
Note that clauses beginning with what act as subjects or objects and are called nominal relative clauses.
Cases where what is not used
What cannot be used as an ordinary relative pronoun after a noun or pronoun.
- We have shipped everything that you ordered. (NOT We have shipped everything what you ordered.)
- The only thing that keeps me going is my desire to win. (NOT The only thing what keeps me going is my desire to win.)
To refer to a whole clause that comes before it, we use which, not what.
- Ann married her secretary, which made her mother angry. (NOT Ann married her secretary, what made her mother angry.) (Here which refers to the whole clause that comes before it.)
Other words that are often used as nominal relatives include whatever, whichever, where, wherever, whenever and how.
- Take whatever you want. (= Take anything that you want.)
- You can come whenever you want. (= You can come any day that you want.)
- Look at how he treats his wife. (= Look at the way in which he treats his wife.)