As you'll begin to see, any time you can establish an overhook on one arm, it's just a matter of getting wrist control on the other arm, and then... Bam! Triangle. This not only applies to closed guard, but also very much so to open guard and even to the top of side control. We'll start with closed guard first, so that you can see one of the most basic setups first.

Start by controlling your opponent's posture. Once they're under your control, shoot for an overhook. There are many different approaches to getting the overhook as well, but we'll just keep it simple for now and swim through to grab it. If you slightly angle your hips to the same side as the overhook, you should be able to get a much deeper grip, possibly even grabbing your opponent's lapel (or your own, if you can't reach theirs).

Now it's time to get that wrist control. Again, there are numerous approaches, but we'll just start by establishing inside control with our forearm first, and then our shin. Once you're blocking with the shin, you can slide down to control the wrist. The triangle is just a retraction of the knee away, and a little jump to seal the deal.