It is by no means a foregone conclusion that your bike will get stolen in New York City. You just have to be smart. Here is what I've learned.
What qualifies as a good lock changes over time. Generally, the Kryptonite motorcycle brake lock with a hardened steel chain is a good choice, unless it's one of the ones that you can pick with a ball point pen. I have one of these and it's lasted for years, and is happily from before they started using the cheap, pickable tumblers. There's also a Kryptonite New York Lock, which is a U-lock, that's supposed to be quite strong. Update: This thread on BikeForums.net discusses a test done by the magazine "Cycling Plus". The gist is that the Kryptonite New York 3000 is the best, and if you don't want to spend 65 dollars for a bike lock, then the $24 OnGuard Bulldog Mini is a good one. The article doesn't discuss the Kryptonite chain lock.
Get at least one really tough lock to go around the frame and whatever you're locking to, and then maybe a cheaper cable lock to lock the other stuff.
Note that just because a lock or chain looks thick, it is not necessarily hard to clip. If you supplement your main lock with a cable lock, know that these can be cut with large clippers. If you bought your chain at a hardware store, and the guy at the store cut it off a long spool of chain with some clippers, a theif can cut it off your bike with the same type of clippers.
You can't really lock everything, and this becomes a problem on more expensive bikes where things like the handlebars and pedals are worth a lot, in a city where anything that doesn't have an armed guard will eventually get stolen, or at least have a dog piss on it. That said, the average bike theif goes for wheels and seat, if he can't get the whole thing. You need to lock the wheels, the frame, and the seat.
One approach is to use your strong lock to go around the front wheel, the frame, and what you're hitching to. Then use an auxiliary cable to lock the seat and the back wheel through the rear triangle of the frame.
Another approach is to use two strong locks, one for the front wheel and the frame and one for the back wheel and the frame, and use a piece of bicycle chain to attach the seat to the frame. I've started using the Master Lock 527 D to lock my back wheel to the frame, by passing the lock through the wheel and around both seatstays.
Just make sure you're locking those four things (and make sure you're not just getting the spokes, but the rim of the wheel).
Hose clamps on quick-release levers don't work.
Locking your bike next to a badly locked up bike is a good idea. In front of a police precinct is a good idea. Any well-trafficked area is good, though no guarantee of not getting ripped off. I once saw a guy going at a U-lock with a 2x4 right on Broadway and Washington, in full view of 100s of people.
Also make sure that what you lock to is going to stay put. A long chain on a short parking meter could also be trouble.
Make sure your bike's not going to tip over and get kicked by every passer by, or run over by a car pulling up to the curb.
This is a subchapter of "Choose a good location". Not only do you want your bike not to get stolen, you don't want it to get fucked up. When choosing a good location, make sure you're not blocking the sidewalk, you're not in the place where the restaurant puts its 300 pounds of wet garbage every night, and you're not blocking a door or something. Supers have bolt cutters, and will remove bikes if you piss them off. People will also kick your bike, knock it over, etc. Bikes inspire enough irrational hatred as it is, so be aware of this when locking to things.
Finally, don't leave your bike out if it's had a part stolen. This just brings thieves in like jackals to a wounded wildabeest. As soon as something gets stolen, or even if you get a flat, get that thing off the street.
If you don't yet have a bike, you can get one that is good for the city and doesn't look too flashy. The most stolen bikes are mountain bikes. Anything with a comfy seat and big tires is more in demand to thieves. A good bike for the city is a Raleigh 3-Speed type. These were imported in the 50s and 60s, when American adults didn't really ride bikes too much. If you look around, a lot of these British clunkers are still around. Now, how many bikes from the 70s and 80s are still around?
Places like Bikes By George on 12th Street (between 1st and A) and Bike Works can hook you up with a decent used bike, and install the piece of bike chain between the seat and the frame. I especially like Bike Works. Both places will assemble a bike to order, based on what you're going to be using it for, how far your commute is, etc.
If you're set on getting a new bike, or want to shop for locks and accessories, Gotham and Toga are two good places to go, with less attitude than most, and decent prices.
Something without complex derailleurs will also go longer without needing a tune-up. A good investment are some puncture-resistant tires. If you have a basket, people will put garbage in it.
Worksman Cycles make industrial bikes that will last forever, and they're making them right here in New York City. They're pretty cheap, too. About $300 for a bike that will last 20 years. And they're heavy, but this can be good. If somebody pops their car door open in front of you, you might take it off and keep going.