I used to do it years ago...
1. You need to collect it offshore if possible, preferably a few miles off, from a boat and make sure you avoid the outboard motor/exhaust end of the boat. Avoid marinas and inlets near shore, they will often contain pesticides, human waste, bilge oil, fuel, etc.
2. Store the collected water in sealed containers in total darkness for a month and this will kill any floating pathgens. After that aerate it for 24 hours, adjust temp and SG as needed and you should be okay. Sure, it's a pain, that's why they make Instant Ocean.