Poles and low jumps in a gymnastic line work wonders!
I use The 5 Steps Back to Play protocall. First step is to stretch them out, then add some transitions. Get them on a circle to flex, don’t worry about being on the bit unless that’s how your horse naturaly carries itself. Then add some full ring canter to halt, walk canter transitions.
With time, patience and bodybuilding excerices
There are many ways, depending on your discipline. The best and funnest way to get your horse back in condition is to go on a hack, but walk as that is tiring for horses, gets them into a good condition and also builds muscle
Hope this helped!