As a beginner in photography, it is frustrating when you see something gorgeous, but you can't capture the beauty the way you see and feel it. Many things are important to take into account, like configure your camera to fit your vision, the angle of the camera, lights, etc.
Composition is one of these concepts that matter. The first reaction you have is to put the main subject in the middle of your photo. Most of the time, it is not that great of an idea.
The rule of thirds appeared in painting first, and has been used in photography since the beginning. It is a rule meant to help you highlight parts of the scene you want to immortalize.
Take your frame, split it in thirds horizontally and vertically, drawing two lines in both directions. Now if you want to highlight subjects on the scene, the rules says you can place the subject at an intersection of two lines. It's very simple, you just have to get used to it and have some practice. The main question you need to ask yourself is "what do I want to highlight?".
When you imagine these lines, you can also use them to superpose other lines on it, such as the horizon, or imaginery line that would join two or more points of interest (eyes, shoulders for example).
You do not need to apply this rule, and composition is much more than this rule alone. But you should definitely try ut and you will see many of your photos will look better this way.
Here are various photos to illustrate this composition rule.