Consider a fluid at rest in a container. The density of the fluid is $\rho$ and the height of the fluid column is $h$,as shown in the figure.
The weight of the fluid in the cylinder is $W = mg \ldots(1)$
Since the mass of the fluid $m = \text{volume} \times \text{density} = Ah\rho$,
$\therefore W = (Ah\rho g) \ldots(2)$
The pressure produced at the bottom of the container due to this weight is
$P = \frac{\text{Weight } W}{\text{Area } A}$
$\therefore P = \frac{Ah\rho g}{A}$
$\therefore P = h\rho g \ldots(3)$
This equation shows that the pressure produced due to a fluid column depends on the height of the fluid column $h$ and the density of the fluid $\rho$.