There is a tool called a brake. It's for bending sheet metal nice and straight. I don't own one (wouldn't have room for one anyway.) Instead, I can use a couple of hardwood strips clamped together tightly and bend the metal along the edge of those hardwood strips.
Once I get those edges folded back on themselves, I hammer them as flat as I can on the floor.
Now the whole affair is compact enough that I can clamp it in my vise to complete the folding.