There are a lot of variations to the arm bar from guard, but I'm going to assume you're referring to a basic version. I'll run through the mechanics of one of the most basic variations, bearing in mind that your instructor might do some of the details slightly differently.
Attacking your opponent's right arm, secure his arm and pull it across your body to your right side, trying to get his elbow at least to the centerline of your body, preferably past it. I like to use a cross grip with my right hand going over his and gripping his right elbow, but there are a lot of legitimate grips you can use. If you use the cross grip with your right hand, then your left hand can control his collar to keep his posture low.
Place your left foot in his right hip, with your left shin tight against the right side of his body and shoulder, This will create a barrier to prevent him from pulling his arm back and the foot on the hip will help you rotate your body.
Turn your body 90 degrees to your opponent, with your head coming close to his left knee. Your right leg will slide up his body high into his left armpit and your right calf can clamp down onto his back to prevent him posturing up.
If you are using the cross grip with your right hand, you can now use your left hand to push the side of his head and make a little extra room for your left leg to swing over his face. If not, just swing your hips out a little more so that your left leg comes around his face and clamps over the back of his neck.
At the end, you should be 90 degrees to your opponent. Your head is as close as possible to his left knee. Your right leg is high into his left armpit and clamped down onto his back. Your left leg is over his neck - ideally with the back of your knee on the back of his neck, your thigh against his face, and your lower leg and foot curling down hard towards the floor on the other side of his head. Secure his wrist to your chest with both hands and raise your hips to finish the arm bar.
If you have the perfect leg position explained above, you should have his posture controlled sufficiently that he won't be able to stack you or lift out of the arm bar. Unfortunately, we can't always get the perfect control position.
If your opponent is able to start standing up and lifting you, keep control of his arm with your left hand and hook under his left leg with your right arm to prevent the lift. If he can stand up anyway, release the arm bar so you don't get picked up and slammed.
If your opponent is still able to stack you, then you may need to sweep him, spin under for a belly-down arm bar, or bail, depending on the circumstances.
Hope that helps. If your instructor was showing a variation that is significantly different from the one I described, give me some more details and I may be able to identify it.