The honest context
New York City today is significantly safer than its reputation among people who haven't visited recently. The dramatic crime spike of the late 1980s and early 1990s is the reference point for a lot of people's mental model of the city, and it no longer matches the actual city. By most measures, New York is safer than the US average for major cities — and vastly safer than visitor anxiety before a first trip often suggests.
That said: it is a large, dense city of 8 million people, and the things that affect safety in any large city exist here too. The goal is calibrated awareness, not false reassurance or unnecessary alarm.
What visitors most commonly encounter
Petty theft and pickpocketing: the real, ordinary risk in any tourist-heavy environment. Times Square, crowded subway platforms, and busy transit hubs are where this is most likely to happen. Keep your phone in your front pocket rather than a back pocket or open bag, be aware in crowds, and don't leave things on café tables unattended.
Scams: a few standard ones persist around tourist areas. Street hustlers near Times Square who offer CDs and then demand payment; "signed" merchandise that turns out to be worthless; taxi drivers who take obviously wrong routes from airports (get the flat rate from JFK and use the meter from everywhere else). None of these are dangerous — they're just irritating and avoidable with mild awareness.
The shell game and card games: often run in Midtown and on busy streets. They look like games of chance; they are not. The people playing along are part of the operation. Do not stop.
The subway
The subway is safe to use, including at night, in the vast majority of cases. It runs 24 hours; the busier stations and more central lines are the safest; late-night travel on quieter lines is something to be normally aware of rather than afraid of. Stand away from the platform edge when trains are arriving, keep earphones at a volume where you can hear what's around you, and be aware of your phone when using it on the platform.
Neighbourhoods
The idea that large sections of New York are "dangerous neighbourhoods" a visitor should avoid is largely outdated. The areas most visitors spend time in — Midtown, Lower Manhattan, Brooklyn Heights, Williamsburg, Astoria — are safe in the conventional sense. The city is uneven in income and resource distribution, and some areas experience higher rates of crime than others, but this rarely affects visitors who are passing through rather than involved in local disputes.