Over and above
all other considerations - if you wish to learn how to walk in NYC the best possible advice
that can be given is walk like you know where you're going
See, for the most part unless you've done something to deserve it, the less savory elements of NYC life tend to target outsiders. Whether that be outsiders to a given neighborhood or tourists makes little difference.
If you look like you don't belong in a given place your likelihood of being fucked with by someone you don't want to be fucked with by increases significantly.
Walk with confidence, don't dawdle, keep your eyes in front of you or down and you can walk relatively at ease in any neighborhood in the entire city and never be hassled for all your days...