When an object is placed in a fluid, the fluid exerts an upward force we call the buoyant force. The buoyant force comes from the pressure exerted on the object by the fluid. Because the pressure increases as the depth increases, the pressure on the bottom of an object is always larger than the force on the top - hence the net upward force.
The buoyant force is present whether the object floats or sinks. Let's consider a floating object, but the analysis is basically the same for a submerged object.
We'll also consider a rectangular block, although a similar (more complicated) analysis leads to the same result for funny-shaped objects.
The object experiences forces on each of its six sides. On each side, the force is the pressure multiplied by the area of the side, and is directed perpendicular to the side and toward the inside of the object.
The force on the left side is tricky to calculate, because the pressure is different at different levels. Fortunately we don't have to calculate it because this force is equal-and-opposite to the force on the right side. Similarly, the forces on the front and back cancel.