Chapter 4 of Fossil Fighters can be a bit of a maze, so here's a walkthrough to help you through it.
Start by heading to the bay. Go up and smash one of the blue rocks, which can take a little searching to find. Breaking it reveals a hidden passage. Go through, and you'll come to a pirate ship. Head inside and keep trying different combinations of stairs until you reach the captain's quarters, where his ghost appears and asks you to find his beard ribbon.
There's an optional detour here: head downstairs and walk up one of the narrow wooden stairways, then try coming back down from each of the rooms. Eventually you'll meet Holt. That part isn't required, but it's worth doing.
From there, your task is to locate the captain's beard ribbon. I'm still stuck on that step myself, so that's where this guide ends. Good luck, and happy fossil hunting!