I am not entirely sure what you mean by your router works perfectly when you plug the cable into the wall socket but when you try to plug it into the router it doesn't. What type of router do you have? Is it just a router, a modem/router or do you have a separate modem too?
Assuming you just have a router. First of all have you plugged in your router to a power supply?
Have you connected your router by ethernet cable to the filter that is attached to the box that brings in the telephone supply - this filter has your telephone connected to one socket.
Are there lights on your router?
If so, go through the process of setting up a wired connection first by attaching an ethernet cable to your computer to the router. You then have to fill in the details requested by the connection wizard.
Once this wired connection works you can then disconnect the ethernet cable from your pc and attempt a wireless connection.This article gives you the steps.
You do not say which operating system you are using.
Are you using a laptop? If so is the wireless enabled?