See Chapter 4 of this IATA document for flight crew management of unruly passengers.
In general, they will weed a lot of the negative behavior out on the ground prior to boarding by looking for signs of agitation or aggressiveness towards other passengers or crew. Should a passenger becom unruly while enroute, the following is generally done.
Assess the situation and level threat: what's happening? who is doing it? what are their grievances? Are the legitimate e.g. A family member having a medical emergency or trivial e.g. Passenger in 22B is drunk and aggressive?
If there are other than legitimate reasons for the disruption, action in taken using the use-of-force continuum:
Physical presence - flight crew will be nearby watching subject.
Verbal commands - confront subject. Inform them of both the airline's and Law Enforcemnt's zero tolerance policy toward their exhibited behavior. Inform them if they continue with this behavior the aircraft will be landed, they will be placed under arrest by LE on the ground, and that penalties for their actions are severe. Try to calm them down as well, but do NOT serve them alcohol, even if requested.
If behavior continues, quietly inform the cockpit crew of the disruption and they will make arrangements to divert to nearby airport and inform local airport police and other LE agencies to be ready on the ground.
If passenger has become so unruly that they are posing an immediate threat to other passengers around them, physical force can be used to restrain them by the flight crew. This poses a high risk and should only be done as a last resort to regain control of the cabin. If there is a federal Sky Marshall(s) on board they can assist the crew here as well.
Restraints such as handcuffs and the waist belts may be used to immobilize subject until LE can take over. Divert will become urgent.
Electro Muscular Disruptors - flight crews are now being equipped with and trained on the use of the TASER EMD systems to immobilize unruly passengers in order to restrain them.
If subject's actions pose an immediate threat to life and limb of passengers and threaten the safety of the aircraft and crew (VERY low probability but it is is a contingency), deadly force may be used to neutralize the threat. Near as I know some Capt./FOs do carry firearms as do Sky Marshals. I'm not aware of guns being issued to flight attendants.