The Triangle is a lethal technique that you must have a strategy including techniques to escape and avoid being put to sleep. Here Scott Epstein also known as Einstein from 10th Planet Jiu Jitsu Hollywood demonstrates a technique that should help you escape the Triangle.
The best defense is not to get caught in the first place but if your opponent has some good setups and you find yourself in the Triangle the first thing you want to do is look up to establish your posture. If your opponent starts to pull your head down you have to use your arms to break their grip.
In the video Scott does this by controlling his opponent's biceps. The he quickly steps up and controls his opponent's wrists and sits down with his feet on his opponent's biceps. Then he can arch back and break the Triangle open.