Newton’s universal law of gravitation states that every particle of matter in this universe attracts every other particle with a force. This force is directly proportional to the product of their masses and inversely proportional to the square of the distance between the centres of these masses. The direction of the force acts along the line joining the masses.
Force between the masses is always attractive and it does not depend on the medium where they are placed.

Let, m1 and m2 be the masses of two bodies A and B placed r metre apart in space
Force
F ∝ m1 × m2
F ∝ 1/r2
On combining the above two expressions
F ∝ \(\frac{m_1 \times m_2}{r^2}\)
F = \(\frac{Gm_1m_2}{r^2}\)
Where G is the universal gravitational constant. Its value in
SI unit is 6.674 × 10-11 N m2 kg-2.