“Awhile” is an adverb. It modifies a verb and means “for a short time”: He chatted awhile and then left. “Awhile” should not be used as the object of a preposition, so constructions like “for awhile” or “in awhile” are wrong.But here’s the tricky part: “while” is a noun meaning “a period of time,” and can be used with a preposition, preceded of course by the article “a”: He chatted for a while and then left. The meaning is the same. (Note that the noun “while” can also function as a direct object: I have just a little while left.)