You'll need to make a few subway transfers along the way; take AirTrain from terminal to Jamaica Station, transfer to inbound E subway to Roosevelt Ave/Jackson Hgts, transfer to inbound #7 subway to Queensboro Plaza, transfer to Astoria-bound N or Q (replaces the W) subway to last stop.
You'll need to make a few