(US only)
If you want to vote in the a US election but cannot get to the polls in person, you can use an absentee ballot, but you must do some preparation. You must request a ballot, have it mailed to you, vote, sign your ballot, have two legal-age witnesses sign your ballot, and mail it back by the time the polls close.
If you want to vote in local and state elections, you often must register to vote in person. In many cases you cannot both register to vote online *and* request an absentee ballot (you have to show up in person for one or the other), but check with your local board of elections. http://www.voter.com will tell you who your local elections board is, what your deadline for registration / ballot request is, and will usually provide you with a request form (though some elections boards, like mine, require requests be put in writing).
If you are a US citizen living outside the US and only want to vote in the federal election, you can register and request an absentee ballot at the same time at http://www.voter.com/home/registertovote/0,3233,2--,00.html
Be sure to request an absentee ballot as early as possible. Especially if you live overseas, they can take quite a while to reach you, and of course they must be back in the hands of the election officials by the time the polls close, so mail it back right away.