There are a lot of ways.
Some of the basic elements I learned are:
1) Get off line and grab, maintaining adhesion.
2) Bring the weapon into a position of greater control,
3) Strip.
Getting off line means getting out of the path of the muzzle. If the muzzle is actually touching your body, this means angling your body and moving towards the attacker, so that the muzzle will slide off of you. The direction to turn depends on the attacker's position: front, back or side.
Simultaneously, grab the weapon. Keep it close to your body, but pointed away; this is the aforementioned "adhesion". The idea here is to gain more control over the weapon than the attacker by moving the gun into a retention position. If you both have the gun at arms' length, it's a wrestling match. If he's the only one at arms' length, you have a leverage advantage.
Finally, strip the weapon from his grasp. There are a million ways to do this; most involve turning the gun outward, away from his palm and gripping fingers. Also, wrist locks can be applied at this point, but you're going for a quick break rather than compliance.
At every step, distract and harass as necessary. When you close, give him something to think about: an eye jab, perhaps, or even a good punch to the face as you grab the weapon.
The nice thing about this system is that, with tweaking and practice, it works with handguns and long guns.
Disarms that rely on the function of the weapon make me nervous. The cylinder grab on a revolver works, if the revolver isn't cocked. But all the attacker has to do is get your fingers off the cylinder.
Pushing the slide back to jam the weapon is even riskier, because you are pushing in the same direction that the attacker will try to pull to free the weapon. If he pulls quickly enough (and he probably will, as that is a reflexive action), the slide will go back into battery and he'll still be on target.
As for the old Beretta trick, this is a very fine motor skill. I would only feel comfortable about it if I practiced it hundreds of times, at full speed, with regularity. And then it only works on Beretta 92s. Not much of a payoff.
For any technique, practice is the key. Get some friends together. Use dummy guns and eye protection, and just try to figure out what works and what doesn't. Encourage the guy holding the gun to think up scenarios--different grips, ranges, stances, on the ground with him straddling you, etc. Then, for a real test of how you're doing, toss the dummy gun on the ground and have two guys go for it. The one who gets it first is the attacker, and the one who doesn't is trying to disarm. Hee hee! Try to find that takedown catch now. This introduces adrenaline into the equation.