Did this a month ago - subway and train was amazingly straightforward. Went from Times Square on the subway to a station (Jamaica Station?) with a train that only stops at the airport terminals. Cost about $11 I think, and was quicker than the cab we'd got from the airport into the city the week before. Lots of people on the subway doing the same journey and all felt very safe
Done that same journey. Cheap and quick.