Electronic Arts video games use dedicated servers from the company for many different online features for their games. A failure to connect to the EA servers can be caused by several different factors, and you'll need to troubleshoot each point of failure to determine exactly what is causing you to not be able to connect to the servers.
Check your modem or router to ensure that you have an active connection to the Internet. If your Internet connection isn't working properly, it's unlikely that you'll be able to connect to the EA servers. Unplug your modem and router for 30 seconds, then plug them back in. In many cases, this type of power cycling will fix the modem problem.
Check the release date for your EA game. If you're attempting to connect to the EA servers on the launch day for that game, the servers may be overloaded with the number of connections. Wait a few hours to see if the problem clears up.
Check your computer or router firewall settings. A firewall restricts Internet traffic on your computer or router, and it's possible that the firewall is stopping packets of information from the EA server. Most firewall software allow you to add an exception for a specific program or IP address. If all else fails, you can temporarily disable the firewall to see if that resolves your issue.
Check that the game is currently supported by EA for online play. Older games are phased out of online play by EA, and the servers are not available.