Carlos, I live in NYC and have both a handgun and a shotgun. Admittedly the permitting process for the handgun is much more of a pain to get through.

To ask handgun vs. shotgun is a bit like asking hammer vs. screwdriver, but having said that, if I could only have one firearm, it would definitely be a sidearm. Absent literally the WORST CASE scenarios, I dont think it is possible for you to walk around with a long gun publicly (and keeping a long gun in a big gym bag really takes it out of commission for tactical purposes).

Sidearms can be carried discreetly, and are tactically effective by skilled shooters to probably 25 yards. It is somewhat difficult to imagine a situation where you're defensively engaging targets past 25 yards.

Somebody mentioned getting firearms training, and I think that's clearly a good idea. Also, consider buying less-than-lethal tools like pepper spray (legal in NYC), which gives you more options than if you only had a handgun.