What is the word what in a sentence?

You'd have to give the sentence to say for certain. It's probably a pronoun, but it can also be used as a noun, adjective, or adverb at least.