Here are some steps to try to fix that:
1. Make sure you are using the correct ip adress, check the server list very closely.
2. Make sure you are connected to the internet, your router is on, the wifi connection is still available etc.
3. Make sure you are not using a cracked account.
4. Make sure you are not trying to log into a server while someone else is logged into your account at the same time.
5. Try more than one server, sometimes specific servers may be down, but not others.
6. Try logging in on another account or computer.
If all this fails, then I am unsure of your problem and you should just play it at a friend's house or something/