Gravitational force of attractiion between two masses m1 and m2 at a distance of r meter is
F is proportional to m1*m2/r^2
F=Gm1m2/r^2
if we know the force masses and distance between them we can calculate the value of G and it is constant given by
G=6.67*10^-11m3⋅kg−1⋅s−2