I think this is one of the reasons why new chess players are advised not to study openings. The common argument is that you would be better off spending your time studying tactics and working on you calculation skills, rather than memorizing deep lines in one particular opening.
I think there's a balance though. Decide what opening you like to play as White, and learn like the first five moves or so. Have a plan for what to do against common responses, but don't try to memorize every possible variation. When Black, have a plan for what to play against 1 e4 and 1 d4, but only for a few moves. Don't worry about all other possible odd-ball openings. This is my approach, anyway.
Every time I learn a new opening, my opponents just not play that line.
When I learn an opening, 90% of my opponents seem to know I like playing that opening and don’t play it. Can someone explain why?
Example, I learnt many common lines of the Italian Opening, then 80% of my opponents play d4 or Ruy Lopez, then I learn those openings and my opponents play some random stuff.