A heavy ship can sail because it has sails, an engine, or some means of propulsion. If the question is about how the ship can float, it is the buoyancy of water that allows it to avoid sinking. By using a strong hull and making it "hollow" inside, the hull will displace water. The amount of displaced water will equal the total mass of the vessel. As long as we keep water out of the "inside" of the hull, we can put lots of stuff (cargo) in it and it will still float. The vessel will only sink to the point where it displaces an amount of water equal to its total mass. As long as the hull is watertight and rises above the level of the sea (so it can't take on water), it floats.
Chat with our AI personalities