dx
In chess, there is something called calculation. When an opponent makes a strange-looking move, you can calculate several moves to find a solution that works so you do not fall into a trap.
Do not rely on memorization. That is a sure way to limit your development.
if the opponent makes a strange move that initiates such complications that you cannot calculate your way through, rely on general principles. If you have not violated any opening principle, then you should be fine.
in speed chess, strong players often experiment with new moves or move orders. If there is not enough time to calculate, use general principles.
And if you make a mistake and lose, then you will remember what not to do the next time.
...?