It's very tough but it's not impossible.
He's essentially a superior Garchomp. Faster speed. More damage. Tankier. So you gotta deal with him like you deal with Garchomp.
He also has a stupidly predictable moveset. Again, like Garchomp. His moves are:
1. Stone edge / rock slide (in multi battles)
2. Close combat / sacred sword
3. Swords dance
4. Substitute
I say predictable like it's an easy thing to fight. But between his two moves he can kill anything in two hits and many things in one. But anyway, basically you have to outsmart him or have a setup sweeper like Blaziken / Scizor be fully pumped up so they can 0HKO him when he switches in. Also, if for some stupid reason the enemy doesn't have substitute, just hit him with a will-o-wisp and Terrakion is made completely useless.
Here's an example of an outsmart:
1. You have Charizard out. Enemy sends out Terrakion.
2. You know that enemy will use stone edge. So you can send out something that can tank stone edge. However, the problem is that there almost isn't a single pokemon that can tank stone edge and then kill Terrakion. But you have a plan. You send out Ferrothorn.
3. You now know the enemy will use close combat. Ferrothorn can't kill Terrakion (unless Terrakion switched into a power whip) but you can switch again. You switch for Azumaril to tank the close combat and royally screw over Terrakion.
4. Azumarill comes out and takes minor damage from close combat. Terrakion now at negative stats. Now Terrakion is forced to switch or die to aqua jet.
Setup sweeper is mostly just preparing to fight him. Generally, you're at an advantage if he's sending Terrakion to fight you and you're prepared for it by having someone like Blaziken or some other super fast, super heavy hitting sweeper out. He'll die in one hit.
Here's a simple list of pokemon you should consider for anti-Terrakion duty:
1. Blaziken
2. Azumarill
3. Scizor
4. Infernape
5. Aegislash
6. Rotom-W
7. Trevenant
8. Gourgeist
9. Conkeldurr
10. Mewtwo
My personal experience with battling Terrakion has been I generally have to sacrifice my current pokemon so that the next one can come in without taking damage.