Both, actually.
If a body has density lower than that of liquid, it floats in the liquid, unless the buoyant force and external force in upward direction is overcome by forces in downward direction.
Similarly, if a body has density higher than the liquid, it sinks, unless the sum of buoyant force and external force in the upward direction overcomes the forces in the downward direction.