There are 3 main airports that serve New York City: JFK, Newark, and LaGuardia. All of these airports are quite far from the city, so be prepared for a long journey.
Depending on where you are staying, the journey may be longer than others. Using Times Square as a place of reference, all airports are about an hour away by train. Luckily, the subway runs 24/7, so you can arrive at the airport at anytime and board public transportation. Make sure you know what station is closest to your accommodation and there are plenty of airport staff to put you on the right subway line.
One of the best ways to get into the city and avoid public transport is to take a shared shuttle bus. There are many official companies and some of the shuttles drop you off right in front of your accommodation! The only downfall is that you may be the last person to be dropped off, meaning that you have to ride around to other people’s destinations first. But a one-way ticket from JFK to Manhattan can be as low as $18, so is it all that bad? You can book a ticket at the airport, or buy it online.