the closest will be at the Jamaica station.
There are 24 hr vending machines
and during the day at the jamaica station MTA (metropolitan transit authority)
Google maps is a great site for NYC public transportamntion ands also you can look at the MTA site
Search MTA in google
\
Your question