The word "but" is used in two different ways. It can be a preposition, a word that singles out someone or something from the rest of the statement. And it can be used as a conjunction to join two independent statements together in a single sentence.

"But" as a Preposition

Use "but" as a preposition to single out someone or something as exceptional. It this context, "but" can be understood as a synonym for "other than." For example, "There was no one in the room but Janet." In this sentence, "but" indicates that Janet was the exception; the room was empty except for her. In this context, the sentence could be changed to "There was no one in the room other than Janet," and it still has the same meaning.

"But" as a Conjunction

"But" also acts as a conjunction; you can use it to link two independent statements in a sentence. The second statement either contrasts, discredits or adds additional information to the first statement in some way. For example, "Alicia wants to go to the party, but she has to work tonight." In this sentence, the two statements are "Alicia wants to go the party," and "she has to work tonight." The word "but" linking these statements indicates that Alicia's work affected her ability to go the party. When using "but" in this context, it is always preceded by a comma.