I always recommend isolating the problem as quickly as possible.
First figure out if the modem and router are working properly. Connect with any other device to the internet to check this.
If other devices can connect than this is an issue with your computer, in which case the guide Matthew suggestion is perfect.