First of all, if you ever don't know what to do in the opening (like they play a move you haven't studied), then your default should be to just fall back on chess opening principles, since they are foundational to the opening stage of the game:
https://www.chess.com/blog/KeSetoKaiba/opening-principles-again
I also created a video 6 months ago, on the topic of punishing bad openings. It is mostly examples and the thought process for how to navigate the position.
As for the study of the openings you do encounter, your "study" will depend on what you want to get out of that opening and how likely you are to play it regularly or not. For most openings, you'll just want to learn the key patterns and ideas for both sides more than memorizing specific moves and variations.
Hi guys, today i just got a book called FCO (Fundamental Chess Openings), i just want to ask how to study an openin properly, what should i learn, and im confused what to do if our oppenets play another move that are not in the mainline or other variations, and im confused what the ideas of oppenings are like italia game what should i do next, or after finishing the opening set up what should i do next, Thanks