Before we can fix this we have to know how it happens.
1. Your e-mail account password was used somewhere else. Hackers might break in and steal your login details from another website or service then try those same credentials on the e-mail's website. This happens a lot more than you would think.
2. The e-mail provider was hacked. This happens but is less common as they generally have more security in place. That being said though in 2014 Yahoo was hacked and 500 Million accounts were stolen along with names, addresses, phone numbers, and passwords.
3. You had a very weak password. A weak password could be "password" or "12345678" or maybe even your name. That is why companies are making you use all kinds of combinations of upper case, lower case, numbers, and special characters in your passwords. It is to help prevent weak password issues.