To do an armbar, you need to:

1. Isolate and control your opponent's arm, either from the mount or the guard position.
2. Move your leg over your opponent's head and secure it with your foot.
3. Extend your hips and pull your opponent's arm towards you, applying pressure on the elbow joint.

Alternatively, you can do a standing armbar by grabbing your opponent's wrist and twisting it behind their back, then lifting their elbow up and pushing it down.

Here is a tutorial video that demonstrates how to do an armbar step by step :

https://www.youtube.com/watch?v=QWzgZvN5hYc