As a chess player, you have to know your openings but not necessarily to any great depth .
Not only is it possible to lose a game in less than 10 moves (think of Scholar’s Mate), but the moves you make in the opening set the course for the rest of the game. You don’t want to enter the middlegame with some handicap you incurred in the opening, only to be cursed with it for the rest of the game!
The nice thing about chess openings is that with some study and practice, it’s not too difficult to play the first few moves of a game exactly like a grandmaster would – giving up zero advantages to your opponent and heading into the rest of the game completely equal or better.
THE OPENING TREE
Learn the basics of an opening and the ‘Tree’ will look like this
Take any opening and learn the first 4 or 5 moves

TREE ONE
For example an e4 opening followed by Nf3 and Bd4 – controlling the centre, would look like this:-

Your next move depends on what your opponent plays, leading to more possibilities and branching strategies.

TREE TWO
You might find that developing your pieces thoughtfully is more effective than launching an immediate attack, such as the Fried Liver.
Castling early is good.

As the game progresses, more options and ideas (branches of the tree) come to mind. Depending on what your opponent plays, this leads to increasing complexity in the game. See how the tree grows:
TREE THREE TREE FOUR



TREE FIVE
More and more different lines enter the game. At the beginner level, this is becoming far too complicated to learn or comprehend. Now it is time to adopt the tactics you should know: Pins, Forks, Skewers, Discovered Attacks, Checks, and of course, Checkmate! etc.
My advice is not to waste time memorizing every possible line in an opening. Instead, focus on learning the first few moves of your chosen openings and truly understand the ideas behind those fundamental moves.
Popular Chess Openings
Click on the opening you would like to learn about:-