When I first started Don't Starve: Shipwrecked, I collected a lot of coconuts and didn't know what to do with them until I accidentally found out with the machete.
Step 1: Gather Materials
Gather 3 sticks and 4 flint; these items appear on the island you start on. You don't have to drop them in front of you, but make sure that you have them. Yes, I know I accidentally gathered 2 sticks and 3 flint but just forget about that.
Step 2: Find a Tree With Coconuts and Chop It Down
Look for a tree that has coconuts hanging from the top. You may have to adjust the angle using Q and E to check whether the tree has coconuts or not. Create an axe using one twig and one flint so that you can cut the tree down. Big trees usually have coconuts but I'll end up chopping down all the trees in sight. But I digress.
Step 3: Use the Machete to Hack the Coconuts to Make Half-coconuts
Move the coconut to an open area and use 2 twigs and 3 flint to craft a machete from the toolbar menu. This menu is on the left, you can also open it with Caps Lock. Once you have equipped your machete, right-click on the coconut to hack it into halves.
Step 4: Cook the Halves
Create a campfire and cook the halves to get 2 roasted coconuts per coconut.