Hi everyone,
Counter attack is usually played by opponent if he have strong defense and striker.You can understand counter attack is used by opponent when his team try to counter attack every time which is displayed in commentary.You can also predict from formation.
How to deal with counter attack:
1:Turn on offside trap

If opponent only have one striker or AMC then you can turn on offside trap which will stop opponent team from counter attacking.
It is risky but you have to risk to achieve something.Anyways it works 90% against counter attack formation.

2:Turn on short passes

If your attackers don't play wide and flexible with long passes then opponent will not get chance to counter attack.

3:Low pressing

If you will turn pressing high opponent will get chance to counter attack as your players will press whole pitch.It may result in wide opening of your defense.

4:Man on man marking

As we know for counter attacks opponent will mostly use one striker or even one AMC.Your defense will be ready to block just one attackers and they will prevent opponent striker to create chances.

I HOPE YOU ALL WILL LIKE MY SUGGESTIONS