Holding a guitar correctly is the foundation of learning how to play!
You can get used to anything, so as a beginner is when you should develop good habits.
Holding your guitar is the first thing to learn. Right handed people should rest the guitar body with the neck to the left and use your left hand to press the strings, using the right hand for picking. Left handed people should press the strings with the right hand and pick with the left.
Consider using a guitar strap! A strap will help you hold your guitar in exactly the same position whether you are sitting or standing.
Hold your guitar front forward, not flat on your lap. It may be a little easier to see your fingers when the guitar is flat, but it's harder to fret the notes.
Don't wear a belt buckle as these scratch the back of the guitar.
Press your guitar firmly against your body. The only things moving should be your hands and fingers, not the guitar. Relax, and sit or stand with a strap, using good posture.
The most secure position to hold your guitar, and for the most accurate fingerings, is the position used by classical guitarists. In the classical position, your left leg is raised by placing your foot on an object. If you use a strap you don't need to raise your leg.
Many guitar players prefer playing with the guitar's waist resting on the leg, with the neck horizontal as in the next diagram.
The choice is yours, however, the classical method gives better reach and precision.
Whatever way you choose, stick to it, the less variations in the guitar's position, the faster you will learn!
Always hold the guitar EXACTLY the same way, then, concentrate on your hands and fingers. Make sure the guitar is not going to move about.
Your fingers will begin to move automatically with practice, but, changes in the neck angle etc., will slow down your sub-conscious learning.
How to Hold the Guitar With Your Thumb
The position of the thumb of your fretting hand is important! Place your thumb on the back of the neck, part way across, and line your thumb up underneath your fingers, sort of like holding a sandwich (see the pictures).
Develop this habit as a beginner; wrapping your thumb around the neck is a tough habit to break.
Sometimes guitar players will use their thumbs to play notes on the E string while strumming, or playing bar chords. You can learn that later, for now it's wise to develop good habits.
Holding your thumb correctly will give you better precision and speed.