Find the mass of the first object. For an object that is of equal density throughout, the mass is density * volume.
Find the mass of the second object. If you are looking for the mass of a planet or the sun, these can be found through U.S. Department of Energy's "Ask a Scientist." Tables of the masses of moons and stars can also be found.
Multiply the masses; then multiply that product by the gravitational constant of (6.67 * 10^-11 N m^2/Kg^2).
Divide the new product by the square of the distance between the two objects. This will give you the gravitational, or attractive, force between the objects.