How to counter a very theoretical opening?

When you dont know what to do fo the following:
Opening principles:
Develop towards the center.
Castle.
Connect your rooks.
Place your pieces on active squares.
Look for forcing moves.
When you dont know what to do:
Improve your least active piece.
Force your opponents most active piece back.

A super basic middlegame plan:
Scan your opponents 3rd and 4th ranks (5th and 6th if your white):
Look for weak squares and weak pawns,
Closer to the center the better.
Occupy those weaknesses with your pieces, preferably knights.
Attack backward pawns.
Hmmmmm. Every opening is theoretical. Your question is not clear.
if you follow general opening principles, you should be okay. If the position becomes sharp and tactical, then you will have to calculate. But if you have not violated any of the opening principles, you should always be able to end up okay.
The philosophy behind learning openings shouldn't be "I am learning this opening so I know what to do if he plays this, this and this" - the odds of the opponent playing those exact moves are often incredibly slim. The study of the opening should be more about patterns. This is a big part of why opening theory ends up taking over for advanced players - it's not just the exact lines that might come up, it's what patterns are learned in it.
Hence if you study the openings you want to know well, then if you come across something unexpected you should in theory be able to piece together your knowledge from other openings to do alright in it. I doubt many non-professionals actually know every possible opening they could end up playing against and even if they did - the opponent can simply "invent" an opening that doesn't really harm their position but gets out of book (and only they have experience with), this is particularly the case nowadays when we have computers. If you're well on top of all the standard openings, it should look like something else to you.
You see top-level commentators often do this saying this is like a benoni-type structure or this is like a catalan. It's a lot better to know standard openings really well, than to have patchy knowledge of standard openings but know all kinds of little deviations.

Unfortunately, the "How" is spending time. Study instead of playing online blitz. Study instead of going on a date with your model girlfriend. Study instead of walking with your friends through a sewer tunnel and meeting Pennywise the Clown.
Study Study Study!

The philosophy behind learning openings shouldn't be "I am learning this opening so I know what to do if he plays this, this and this" - the odds of the opponent playing those exact moves are often incredibly slim. The study of the opening should be more about patterns. This is a big part of why opening theory ends up taking over for advanced players - it's not just the exact lines that might come up, it's what patterns are learned in it.
Hence if you study the openings you want to know well, then if you come across something unexpected you should in theory be able to piece together your knowledge from other openings to do alright in it. I doubt many non-professionals actually know every possible opening they could end up playing against and even if they did - the opponent can simply "invent" an opening that doesn't really harm their position but gets out of book (and only they have experience with), this is particularly the case nowadays when we have computers. If you're well on top of all the standard openings, it should look like something else to you.
You see top-level commentators often do this saying this is like a benoni-type structure or this is like a catalan. It's a lot better to know standard openings really well, than to have patchy knowledge of standard openings but know all kinds of little deviations.
What this post says is accurate and here is proof:
https://www.chess.com/forum/view/game-showcase/day-4-of-the-washington-international
Go to that link I gave and look at specifically the second game. White does something completely out of whack! 2.h4 and then an early subsequent h5. This move is ridiculous. However, I had to face it in a long, over the board time control. It is not about memorizing theory. It is about understanding that h4 works when White has a hook, like g6 in the Leningrad Dutch. So I ignored it, made sure I never move g6 until he plays h6. With a pawn on g6, he can get his pawn to g5 to block you from advancing ...g5, and then go h5 and force open the kingside.
So the answer was never move ...g6 unless White plays h6.
So I countered his flank attack with an attack in the center, won 2 pawns, and the game, despite the opposite colored bishops.
If you are willing to learn theory then you can play the Schliemann variation it's aggressive and non-standard so you could catch your opponent off-guard, but it is quite complicated, so maybe you could try the carro-kann against e4 since the opening ideas are quite simple and you get a solid position right from the start.