Theory:

In a beaker filled with water, an iron ball and a cork is dropped simultaneously. Now, what will you observe?

From the picture, it is observed that the cork floats and the iron ball sinks. What may be the reason for this?

If lighter objects float and heavier objects sink in water, then how does a small iron piece sink, whereas a heavier wooden log floats in water?

To answer all these questions, let us learn the concept of density.
Density is defined as the mass of the substance contained in a unit volume of $$1\ m^3$$.
The formula for density ($$D$$) is given as,

$D\phantom{\rule{0.147em}{0ex}}=\phantom{\rule{0.147em}{0ex}}\frac{M}{V}$

where $$M$$ is the mass of a substance, and $$V$$ is the volume of a substance.

The SI unit of density is $$kg/ m^3$$ and the CGS (Centimetre Gram Second) unit is $$g/ cm^3$$.
Lighter and heavier objects
1. Wooden block and iron ball
A wooden block with the same mass as an iron ball takes up more volume or space. Also, the wooden block is lighter than the iron ball of the same size. Hence, it floats on water.

The lightness or heaviness of a body depends on density. If the mass of an object is greater than the volume, then the object will have a higher density. For example, the mass of the iron ball will be greater than the mass of the wooden block of equal size. As a result, the iron ball has a higher density and sinks.

2. Water and oil
When a single drop of water is dropped into the oil, it sinks. However, if one drop of oil is dropped into water, it floats and builds a layer on the surface. Through this, we can say, some oil are denser than water.

Example:
When an oil spill occurs in the ocean, the oil rises to the water surface, creating an oil slick on the top.

Important!
Water is denser than cooking oil and castor oil, even though these oils appear to be denser than water. Castor oil has a density of $$961\ kg/m^3$$, whereas water has a density of $$1000\ kg/m^3$$.
Reference:
https://upload.wikimedia.org/wikipedia/commons/f/f1/Water_and_oil.jpg
https://live.staticflickr.com/7434/12685861633_cf5c25abc8_b.jpg
https://pixahive.com/wp-content/uploads/2020/09/Two-Birds-Sitting-on-a-Wooden-Log-floating-on-the-lake-51745-pixahive.jpg