Very simple experiment:
We draw two random numbers x,y between 0 and 1. Then (x,y) lies within the unit square. A circle with radius 1 covers an area of pi, the overlap of the area with the unit square is pi/4.
So the chance that the pair of random numbers is within the circle is pi/4.
Run the following python code snippet. See how if you increase the number of samples the result gets closer and closer to (the real value of) pi:
import numpy as np
n_samples = 10**8 #number of points drawn
x,y = np.random.uniform(0,1,size=(2,n_samples)) #draw the points
within_circle = (x**2+y**2)<1 #all points with x^2+y^2<1 are within the circle
print(np.sum(within_circle)/n_samples*4) #the number of points within the circle divided by the total number of points is pi/4
Certainly not the most efficient way to get pi, but the easiest.