...It might seem like a stupid thing to spend time writing about, but every single day I see a bike that has either not been locked or has been locked in such a way that even the most ill equiped cycle thief could walk away with a new toy. After several years of absent bikes, stolen wheels and missing seats this is how I tend to lock mine.
First, make sure you've secured your seatpost and saddle- always the first thing to go. I tend to take out the quick release as well- seems a bit silly to make the thiefs job easier!
Use a lock to attach the front wheel to the frame and then preferably to whatever you've locked the rest of the bike to.
Finally, get a substantial chain- the thicker the better and lock your rear wheel and frame to the immovable object you're locking your bike to. Make sure that you take up the slack in the chain- locks are easier to remove with a hammer if they are resting on the floor.