the best defense to Openings


What openings are you encountering that are giving you problems? It seems that certain opening's popularity comes in waves. One week I encounter the Caro Khan a lot, sometimes the French, and this week I am coming up against the Pirc a lot.
For me, I started out by just doing trial an error. Losing many games, and learning what doesn't work. Eventually, I determined the openings I would be most likely to encounter. As black, you have a lot of room to decide how their opening goes. For instance, you can play the Caro, and most people will respond with the exchange or advance as opposed to going with whatever opening plan they had. This would help with your issue if you are encountering it as black as it brings it back into the realm of what you have either experienced or studied.

A lot of people play the Anti-Fried Liver Defense (1. e4 e5 2. Nf3 Nc6 3. Bc4 h6) as a response to the Italian Game at your level. This a bad move for Black though, since it wastes a tempo (wastes a move). White's best option against the Anti-Fried Liver is to play 4. d4 and break open the center to punish Black.
The most common responses to the Italian for Black are 3... Nf6 (Two Knights Defense) and 3... Bc5 (Giuoco Piano). After 3... Nf6, if White plays 4. Ng5 trying to go for a Fried Liver Attack, you can learn the Polerio Defense (https://www.chess.com/openings/Italian-Game-Knight-Attack-Polerio-Defense) and other defense against it.
There are other options for Black after 3. Bc4, but those two are the main ones and generally the best ones. Here are some more options if you want to expand your repertoire.
-Hungarian Defense (3... Be7): This mostly isn't seen much, as the bishop is too passive on the square e7. The only reason you would play that is to prevent Ng5 (which was already covered).
-Blackburne-Shilling/Shilling-Kostic Gambit (3... Nd4: I wouldn't recommend this as it's a very trappy opening. Point is if Black tries to go for a fork on f7, then they either lose the queen or get mated. (remember! this is only if they follow the mainline) https://en.wikipedia.org/wiki/Blackburne_Shilling_Gambit
-Rousseau Gambit (3... f5!?): Black offers up a pawn and weakens his kingside in an attempt to get a space advantage

Against the Two Knights, 4.Ng5?! Is dubious at best. Black should NEVER allow the Fried Liver!
1.e4 e5 2.Nf3 Nc6 3.Bc4 Nf6 4.Ng5?! (4.d3 and 4.d4 are both a significant improvement over 4.Ng5?!) 4...d5! 5.exd5 Na5! (5...Nxd5?? Allows the Fried Liver - 6.Nxf7!) and White has nothing.
Players that play 4.Ng5?! are mostly low rated players that don't understand chess beyond basic tactics.

Hi! I think that for beginners the best defenses as Black are 1...e5 against 1.e4 and 1...d5 against 1.d4. If you would like to read more and get some more insights on openings for beginners, then you might be interested in the post on my blog, see link: https://www.chess.com/blog/maafernan/openings-for-beginners
Good luck!