You do exactly what you did. Develop a piece. Improve your position. Memorizing a line may give you some advantage in that specific line, but, given all the options on the board at any one time, there is no guarantee that your opponent will play that line. That's why you have to know your opening principles.
Ruy Lopez Problems

Hi YouShino,
Thank you for your reply. Sure you're right I know that knowing the principles helps me to move when the opponent doesn't move as I expect.
However, let me clarify my question. I will try to answer by myself so someone tells me if I am right or not.
Let's start with the Ruy Lopez opening exchange variation (according to the article above):
1. e4, e5 2. Nf3, Nc6 3. Bb5, a6 4. dxc6
I am the Black and suppose the White plays Nc3. I cannot play Qd4 anymore.
What should I do?
I think the best option is that the White move dxc6 cause problems to Black because it opened the Bishop diagonal in addition to the Queen file, so my best move is Bg4.
Am I correct?
The goal here is to remove the Knight that protects the d4 cell so I can move the Queen there in the next moves.
Is this strategy correct?
I know there could be thousands of variations but I think this is the only move compatible with the lesson linked above.
Your post is a clear lesson why you shouldn't be studying openings at your level. I give you full mark for trying to understand the ideas behind some moves, but the hard truth is that you're not being completely successful with that. This is because you don't know enough about the middlegame to really understand some of the decisions that are happening. This is not something you should be very upset about, it's very hard to do, and it's just not in reach at your level.
If you look at 4. Bxc6, black would normally quite like 4. ... bxc6. It's capturing towards the centre, and getting more influence there that way. But it fails, because you lose the pawn with 5. Nxe5. Material is by far the most important aspect of almost any position, so losing a pawn is not great.
Therefore after 4. Bxc6 we retake 4. ... dxc6. That's ok, because it also allows us to develop our Bc8, but it's not necessarily the way one might want to recapture (as I said before). The only reason 4. ... dxc6 is needed here is that after 5. Nxe5, black can play Qd4 winning back the pawn.
So if you understand 4. Bxc6, dxc6 as a necessity to not lose your pawn, then it should become clear too what you want to do after a move like 5. Nc3. Find a way to defend the pawn. 5. ... Bg4 does that, because it pins the knight. Another move might be 5. ... Bd6.

I agree with RAU4ever.
Work on tactics and not hanging pieces. The opening doesn't matter at the 800 level if you're blundering away a good position.

Whenever you watch an opening lesson on chess.com, create an analysis board or create a Lichess study and play the moves and make comments on the moves based off of what the commentator says. Also, for knight moves, you say Nf6 or Nxe5 because Ke2 is for King moves only just for the future.
I would say you need to focus more on protecting your pieces and avoiding tactical blunders which I will show in this pgn below

Hi EKAFC,
I didn't know about Lichess Study Plan. I keep notes in a Word file but it is tricky. Is there a way to export as a PDF?

Hi EKAFC,
I didn't know about Lichess Study Plan. I keep notes in a Word file but it is tricky. Is there a way to export as a PDF?
It's not a study plan but you can put in pgn's (downloaded chessgame files) and you can put them into a chapter. You can't export it as a pdf but you can comments on your moves and go through tricky variations. Here is my Queen's Gambit Study for an opening study I made off a book and Every Sacrifice Study based off the Chess.com series. For a new key variation, make a new chapter for whatever opening you are learning and the best part is you can go back to review it or add things with ease. If you want to practice your openings, you could get a Short & Sweet from Chessable on your opening or you could download a pgn of your chapter and put it in ChessTempo Opening Training to learn them better.

I was looking at this lesson on the Italian Game:
https://lichess.org/study/9NXx6eMg
It has a very good look and feels. How did he do it?
A month ago I followed a lesson on Ruy Lopez here on Chess.com. I also read the article here that mentions different variations.
Now I well remember the lesson reported the mainline: 1. e4, e5 2. Nf3, Nc6 3. Bb5.
Now I am Black and I am interested to understand what to do when the Bishop in b5 catches my Knight in c6. I remember the lesson said that with this combination White will have serious problems.
Now I played this game where the opponent was White and after my Morphy defense a6 he played Bxc6 and I replied with dxc6 opening diagonal for my Bishop and the file for my Queen. So far so good.
Now the Chess.com lesson reported the White move Kxe5 and my reply Qd4 to attack Knight and pawn.
My game was a bit different because the sequence continued with: O-O, Kf6, Kxe5. Now I could play Qxd4 but I completely forgot how to reply. Hope to do better next time.
I know it's important to know principles instead of exact moves, but if you remember them you could have some advantages.
However, the way to activate the Queen is that White move Kxe5, but if this doesn't occur what should do the black?