Think about an object floating in a water. There are two forces acting on the object in this case which are upthrust of water and weight of the object. These two forces must be equal so that the object can float in the water.
We already saw the formula for weight.
For buoyancy force the formula is;
Where is the density of the fluid
g is the gravity
And is the displaced fluid volume (in other words volume of the part of the object that is in the fluid)
So if you make them equal to each other;
If we divide both side of the equation with g;