If you can connect to the server but can't play due to persistent disconnects or lag, try the following:
Make sure you are using a broadband connection (25 Mbps download speed and 3 Mbps upload speed or better).
Temporarily close as many other programs that use the internet as possible, particularly things like streaming video - this can prevent reaching bandwidth constraints.
Try using a wired connection instead of wireless - this can avoid wireless network quality problems.
If you have a laptop, try taking it to a different network and playing from there to see if you notice improvements with a different network or different ISP.