Famous Last Words
When used as a phrase on its own, it is often used to give commentary to views on a situation, usually ironic in nature. The idea is to allude to "Last Words" said by famous people, usually before they "met their end", in a urging to make the person being addressed fully consider the ramifications of the situation and their actions before acting. As one of Murphy's Laws of Combat states, "if the battle is going well, you've walked into an ambush."
The perfect canonical ironic example is a husband is cleaning his rifle, and his wife says "Be careful, Howard". To this he replies "Don't worry, it's not loaded" and then promptly get his face blown off. Irony is often a pivotal ingredient in a Famous Last Words quotation.
As far as usage goes, it can be used simply as:
Bill: It's completely safe, I know what I'm doing.
Ted: Famous Last Words!
Other classic examples include reverences to Bill Gates talking about memory requirements or Thoreau talking about Mooses; However, these are not traditionally correct in a strict sense as FLW are typically the last thing said before death. This arguement is countered, however, but eliciting a change in perspective by saying that they need only be words said before an event or occurrence that needs not be fatal.
The first large-scale usage is often associated with Gen. George Armstrong Custer before the Battle of Little Big Horn when he spoke the famous phrase "Hurrah, boys! We've got them! We'll finish them up and then go home to our station.", whereupon he was very soon after slaughtered en masse but to a heinous strategic assumption. This is all good and well, but the term was almost certainly in use long before then -- the difference may have been that Journalists began to publicize the phrase with "Gen. Custers' Famous Last Words" attached.