Qué usually in an exclamation usually means How_____? Or What____? que usually means "that" depending on the wording of the sentence. There are also marks with the lettering that should help you when the words are spelled the same way like: que and qué, or Dias and Diás.
I hope I helped a bit. I'm learning Spanish myself too.