The closer they are, the greater the force of attraction. For most objects you get near every day, the force of attraction is so incredibly small that you would never notice the force. Gravity is a very weak force, so between common objects like you and your pencil, the force of attraction is very small because your mass and the mass of your pencil are small. We call the force of attraction between you and the Earth, your weight. Weight is another name for the force of gravity pulling down on you or anything else.
G is the universal gravitational constant.
This is a universal constant so it is true everywhere. F G is the force of attraction between the two objects. The direction of the force is not given by this formula since there are actually two forces equal in size but opposite in direction. This formula calculates them both. This means that if you double the separation you quarter the force, or if you cut the separation in half you quadruple the force of attraction.