If you take the airtrain at JFK, transfer to the subway, and transfer to LIRR, the whole thing will cost you about $17 or $18.
I’d rather take the shuttle bus, it is also $18 one-way ( not $20). If you take the shuttle bus, you dont have to transfer anything.
You just sit in the bus until it goes to Port Authority.