Hi Samanjoonii,
In your first sentence: "A friendship is like a ship on the sea, it needs to stay afloat.", you have two main (or independent) clauses. If your intention was to join two main clauses with a comma only, then you have run-on sentences which are brought together without a proper connection. To connect two main clauses, you need a conjunction as well.
For example: "A friendship is like a ship [in] the sea, and it needs to stay afloat."
On the other hand, if you intended for "it needs to stay afloat" as an additional elaboration of your starting claim "A friendship is like a ship [in] the sea", you can use a dash (—) for the job.
For example: "A friendship is like a ship [in] the sea — it needs to stay afloat."
* I changed your "on" to "in" as the focus is on a metaphorical ship "in" a large area such as the sea.
For your second sentence: "If a friendship is one-sided, it will most likely sink in the sea of friendship[s].", you have correctly used a conditional sentence to describe a negative future result if a negative situation persists. This is essentially a first conditional — for likely future scenarios.
In fact, you can also the zero conditional, which expresses general truths that apply all the time. For example: If a friendship is one-sided, it sinks in the sea of friendship[s]."
** I pluralised your "friendship" to "friendships" as the sea is a metaphor for so many friendships that one may have in life.
Another example: I was not able to spot my mother from the sea of faces. (sea of faces actually mean the endless number of faces you see, which looks like an endless sea stretching towards the horizon)
I hope this helps.