Let's say you have been practicing a certain opening such as the Ruy Lopez and you have all the main lines down and suddenly your opponent makes some unorthodox move that you did not encounter while studying the Ruy Lopez, so you think to yourself, "Does my opponent have something up their sleeve?" or "My opponent does not know what they are doing". If you think the opponent has something up their sleeve like a trap, you might start to panic and blunder and make irrational moves yourself out of paranoia, but you might start to make irrational moves if you think your opponent doesn't know what they are doing when in fact they do.
So I guess the question boils down to this: How do you know when a move your opponent has made is a sound move (especially if you are a beginner) as opposed to a not so sound move? And once you have made the decision on whether the move was good or not, how do you proceed with development?
There are reasons why the main variations of an opening are "established," and why certain moves are seldom played. If a move is "unusual," there is probably something wrong with it.
So figure out why it is wrong. Maybe it gets the other player behind in development, or exposes a queen, or weakens a pawn. Once you have figured out what is wrong with the move, it is relatively easy to play against it.
Example: In the Ruy Lopez, you (White) and your opponent might play
1. e4 e5. 2. Nf3 Nc6. 3. Bb5 So far so good. But now Black plays
3... Nd4, a "strange" move that moves a knight twice in succession. It forks your N and B so the e pawn isn't really en prise. But now you play
4 NxN, and when Black recaptures on d4, he's got doubled d pawns, and has wasted a move. You can castle,
5. O-O, and have a significant lead in development.