I am not a geek, but let me share you what I know..
First thing first: you can not hack yahoo/hotmail/gmail password ! in real sense.
But how might your email password was hacked?:
1. You might have used easy to guess passwords : your son/daughter's name/your gf/wife name, your mobile/veichle/DOB number or something similar.
2. You used your friends computer/ net-cafe to check emails where your friend had installed some malacious program (like key loggers). This means every single keystrokes were recorded in a program in that computer.. Many people do this and trap their friends/gf and other people. Don't check your important email id in any public computer. (have at least two email id's, one for strickly for official/real purpose. Other for friends/hi-hello type..
3. You were the victim of phising - this means : you saw some link in internet/forums. You were prompt to check your email. Clicked there and yahoo email login page appears (but it is not real yahoo page, but a fake one .. something similar ). You entered your email id and password and clicked log-in. Instead of 'inbox' you saw some message like 'Sorry, login failed. Please try again!' . But behind the curtain, your id/password is already sent to the hacker's email. If you have such experience while using credit card, bank account, email, you should think carefully.
4. Some malacious program installed in your system, (virus etc.). That makes your computer 'a server', amd your computer is sending sensitive data to some remote computer. Specially if you install program like 'weather report' or 'desktop screen', from untrusted source, you are more prone to this.
5. If you are in college/hostel LAN, and there is file-sharing, you should be very careful. Check what folders from your computer are exposed to the network. Sometimes while playing around, you accidently expose sensitive documents to outer world.
6. You trusted to your gf/wife 'too much' and shared your password with her. But she is slow typer, and her friend noticed which key strokes are she pressing while logging into an account.
6. You have not changed your password for last five years when your friend created an email account for you first time when you were in class nine.