Most modern modems will do this for you automatically using the below process.
Disconnect all devices from each other first and power down the modem, router and make sure no other connections are active (wireless for example).
Factory reset the modem with the reset button on the back.
Connect the modem to the wall, and turn it on. Allow it to obtain an IP address and so forth until you have solid green lights.
Connect the WRT54G to port 1 of the modem and power it on. Allow it to do it's thing.
The modem should, in theory and most cases, detect that the device on the other end is a router and switch to 'pass-through' mode so you can use the WRT54G as your access point once again...
With that being said, this process may not work so I did a little searching and how this
page with a walkthrough on how someone else was able to accomplish just that.
Humans are the only creatures that won't live up to the their potential. Give everything your all. When you die, die on E.
So I ask you, what do you intend to do now?