#1 is to not carry a folder clipped to your pocket. Seeing a clip on your pocket is what initiates a stop for most people as knives have to be concealed in NYC (opposite of most areas). Drop it in your pocket and your chances of being stopped are greatly reduced.
#2, make sure the knife's blade is less than 4". NYC has a blade limit of
less than 4". Measuring tip to handle is probably the safest bet.
#3, make sure that if your knife has a lock, that you really need 2 hands to open it. This is part of the ridiculous interpretation of "gravity knife" where they test it by swinging a knife while holding the blade, trying to get the handle to swing out. Even if it takes 20 tries, if it opens then they might hassle you.
This guy won a lawsuit when his locking knife couldn't be demonstrated to be a gravity knife
You can bypass this issue by carrying a non-locking knife. Examples would be a traditional slip joint, a SAK, some multi-tools like the Leatherman Juice (I believe the blade doesn't lock on this one, just don't carry it on your belt in a pouch). Spyderco also makes slip-its for those who live under strict knife laws but be aware you might still get hassled for one.
This guy was carrying a Spyderco UK Pen Knife (I remember them showing a titanium one using KSF's picture on the news) and was arrested but got out of it and won a settlement as his knife as legal. He probably wouldn't have been stopped if his knife wasn't clipped to his pocket in the first place though.
Another option is a small fixed blade but you have to be careful here too as it might be considered a "dangerous knife" (state law, also subject to interpretation)
#4, if you do get stopped for some reason and your knife is asked about, you're carrying it for work as a tool.
Never for self defense. Carrying anything for "self defense" is taken as an admission that you're carrying it with intent to use is as a weapon against someone else and you can be arrested.
Hope this helps and try to enjoy your stay!!