"Don't give up the ship" means to never surrender, never stop trying, never give in to defeat, even when facing very hard and challenging times.
In the Navy: Sailors use it as an official motto to show they must stick together and fight through danger like fires, floods, or hard duties.
In Everyday Life: People use it to tell friends or coworkers to stay strong and keep going when a project or goal gets very difficult.