The trick is to first find out where then work out why
If the belt seems to be flapping then there is something stuck in one of the pulleys
Over time the belt guides end up too far away from the pulleys and need a little bend back
A bad bearing can allow the pulley to twist & then the belt will run up or down and run off
The tensioning arm can come loose so the pulley is canted, same story as above
Tension arm return spring can fall off so again the belt will pop off
But you need to know where this is happening
If you clip rocks, roots, garden edging or have been running with a bent , broken or out of balance blade then one of the mounting arms on the spindle could have fractured allowing the housing to tilt but this usually throws the belt when the blades are engaged
BEcause this is a one man shop, I have an SJ cam ( go pro knock off ) that I clamp to the foot boards so I can video the belt coming loose
I do this for a lot of problems so you can make a video of it happening but do not do it with your phone in your hand it has to be on a couple of bricks or something so it can not shake because the deck will go in & out of focus so much it will not be any use .