With electronic ballots, early voting, and importing voters (not to mention multiple votes), precinct by precinct, pad your tally.
The POTUS election is unique in that the electoral votes are the ones which matter, so hit the high population states, especially urban areas if you are a Dem, and target the electoral total.
The election would have to be won by your opponent by an overwhelming margin (landslide) for you not to prevail, and no one expects anything like that because all they have heard is how well you are doing in the polls.
I noticed something interesting on election night 2012. I thought Romney had a good chance but Fox, as soon as they came on the air, seemed to be already talking as though it was a post-mortem for his loss. My wife and I were weirded out by that.