Take the N, F, D OR Q train to the last stop, Coney Island. The Q and N trains are on the BMT Broadway line; The D and F are on the BMT Sixth Avenue lines.
I must way, though, the water t Coney Island is really the tip of Rockaway Inlet, if you want to see the open ocean, go to Rockaway. Not Far Rockaway, go to Rockaway Park, it's a safer area. Take the A train to Broad Channel, and change for the Rockaway Park shuttle.