Gauss’s theorem states that the total flux through a closed surface enclosing a charge is equal to $1/ε_0$ times the magnitude of the charge enclosed.
The surface enclosing the charge is known as Gaussian surface and it can be of any shape.
Suppose a charge $+q$ is placed at a point $O$. Draw a sphere of radius $r$ such that $O$ is its centre. The total flux due to the charge crosses through the surface of the sphere where area is $4πr^2$.
If $E$ is the electric intensity at any point on the surface of the sphere, then total flux $Φ$ is,
\[Φ=EA\] \[Φ=E×4πr^2 \text{ ___(1)}\]
If the charge is placed in air, then the electric intensity at a point which is $r$ distance apart from it is given by, \[E=\frac{q}{4πε_0r^2}\]
Putting the value of $E$ in $(1)$, \[Φ=\frac{q}{4πε_0r^2}×4πr^2\] \[Φ=\frac{q}{ε_0}\]
This proves the Gauss’s theorem.
More on Electric Field