Beginner photographers generally have difficulties using foregrounds and backgrounds in their images, especially if they are photographing an animated subject. However, what lies in front or behind your main subject can be an effective tool for creating truly memorable images.
If you are photographing a distant subject, a common technique is to place something of interest in the foreground to provide a sense of balance. When done effectively it helps create a flow in the image where the viewer's eyes are immediately drawn to the foreground object and then they wander to the background.
This helps add a sense of depth and perspective to the photograph as well as gives the foreground a sense of scale.
By finding out a viewpoint where closer objects fill in the foreground, you can create a "frame within a frame" in the photograph. With landscape as your subject you can often use nearby vegetation, rock or other appropriate element to frame a distant subject.
On the other hand, do not forget to make use of the background details as these often can add interesting information to the image.
You can use background details to make visual comments perhaps through comparisons between like objects or contrasting shapes and sizes. Here are some examples of how this concept is utilised by iconic photographers such as Elliot Erwitt and Henry Cartier-Bresson :