Always take your Captain Bonus Actions before your Crew Bonus Actions. Captain Bonus Actions are taken in order, left to right: either “Bury, then Attack” or “Bury, then Plunder” (depending on which Captain currently commands your ship). You cannot take the Captain’s Attack/Plunder Bonus Action before their Bury Bonus Action (but you can skip the first and still do the second).
After taking any Captain Bonus Actions, take your Crew Bonus Actions. These can be taken in any order, but each one must be resolved before beginning another one.