Getting to Stony Brook
If you're getting from an airport to the university by yourself, you can get to the Stony Brook train station, which is on campus close to the physics department, in the following ways.
Take the Air Train from the airport to Jamaica Station (cost is $5). At Jamaica you can follow signs to the Long Island Railroad, where you can take the Huntington/Port Jefferson line to Stony Brook for either $10.50 or $14.50 depending on the time.
If you're taking the train you should get to Woodside station. The most efficient way is a taxi or a Lyft or Uber, which will cost around $10. You can also take the bus, namely the Q60-SBS, which costs $2.75 and has Woodside as its final stop. Take the stairs at the station, and go to the Long Island Railroad section where you can get a ticket to Stony Brook for either $13.75 or $19 depending on the time.
Take the Air Train to Newark Liberty Airport Station. At the station you can buy a ticket to Penn Station on New Jersey Transit, which costs $13. Once you arrive at Penn Station, go downstairs to the LIRR section where you can buy a ticket to Stony Brook, on the Huntington/Port Jefferson line, for $13.75 or $19 depending on the time.
Islip (MacArthur) Airport
Taxis are your best option. You can also try to ask a current student to give you a ride.
Getting a ride
You may be able to get a ride from a current student (especially if you're flying through Islip) through either email@example.com or Donald.J.Sheehan@stonybrook.edu or one of the Facebook Groups (public student group, PGSA Facebook Page).