If you are referring to commuting to a job in Manhattan, 40 minutes won t even get you out of the city unless you want to go to Jersey. A lot of people like it there, but I really don t.
you want a safe place to live in NYC? that doesnt cost a fortune? And big enough for a family? have you ever considered moving out of nyc? its really hard for that and you need a price range to get an idea of what may be too much. Because too much to you may be a little to someone else.
Given your perimeters, it s absolutely impossible. Anything even halfway safe is either going to be much more than 40 minutes away or will be expensive, e.g. $400K and up at least.
They r lots of places in NJ. I live in NJ. Good luck!
Try Suffolk county.