I just need some space, OK?

Awhile or a while?
You can say awhile and a while without noticing any difference between the two—they are both pronounced /uh-wahyl/. If you look at the words, you see there’s only a slight difference in spelling—in awhile, there’s no space between a and while, and in a while there is. And both words have something to do with time, so how much difference can a single space really make?

A lot, as it turns out. It’s true that awhile and a while have plenty of things in common, but they are still very different. Awhile is an adverb that means “for a while.” A while, notice, is two words. There’s the article a, and there’s the noun while, which is a period of time. If you put them together, you get that a while means a period of time. And there’s the difference:
Awhile is an adverb that means for a short time;
A while is a noun phrase consisting of an article and a noun, and it means a period of time.

How to Use Awhile

You know now that awhile is an adverb, and you know what it means. When you want to put it to use, use it the same way you use other adverbs: to modify a verb, another adverb, or an adjective. Here are some examples:

“But starting tomorrow (Thursday) the first Thursday of the month, city officials are creating a reason for people to stop and visit awhile.”
KLEW

“I know you all, and will awhile uphold
The unyoked humour of your idleness”
—William Shakespeare, Henry IV

“The guard was joined by another guard and they spoke awhile quietly as the automatic door slid open and people came in, with kids, without, and the man went back to his place at the wall, where he stood motionless now, watching Anthony Perkins turn his head.”
—Don DeLillo, Point Omega

How to Use a While

A while is a noun phrase—a phrase that plays the role of a noun. Nouns can sometimes play the role of adverbs, and a while is not an exception, but this can lead to confusion because awhile is an adverb as well:

“A few tables up front encouraged you to stay a while, and there was a beer tap within arm’s reach of the tables, so you had easy access to something to wash down your meat.”
BBC

While a while and awhile can be used interchangeably in this example because both play the role of an adverb, this isn’t always the case. A while can be used in prepositional phrases, but awhile can’t:

“The company ships everyone its small, adventure-proof cameras and requests little in return: mainly, that they record all the crazy things they get themselves into and send back a hard drive full of content once in a while.”
Huffington Post

“Verona, for a while I take my leave,
To see my friends in Padua, but of all
My best beloved and approved friend,
Hortensio; and I trow this is his house.”
—William Shakespeare, The Taming of the Shrew