In Don't Starve: Shipwrecked you can collect coconuts by chopping down palm trees on the beach. Coconuts can be used as food so you don't starve or they can be replanted. To eat a coconut you need to cut it in half. You can do this by dropping it from your inventory then equipping (after you build it) the machete. Tap and hold the coconut you dropped, then select the cut option. Now you can eat both coconut halves.
In Don't Starve: Shipwrecked you can build a variety of traps to catch birds, bugs and other creatures to use as bait or for food. To build a trap you must collect the correct materials, such as twigs and grass, then assemble it on the crafting screen. Once the trap is built, just tap and drag it from your inventory and place it wherever you want on your world map.