Dig a six inch deep trench on the side you want the fence to lean toward, usually inside your yard. If there are small gaps between the boards of the fence, or you have a chain link fence, weave a rope through the fence so that the fence-straightening won’t make the fence warp or bend. Tie the rope off at the corners. Get sharpened steel stakes made for supporting a fence. Place these stakes inside your yard about 6-12’ away from the fence, about 1-2’ deep, matching one stake with each post or support or gatepost. Use rope, chain or wire to connect the stakes and the posts, creating pulling tension on the fence. Don’t try to straighten the fence up in one day. Flood the trench with water, but watch the runoff. Back into your own yard is best. The foundation of your fence (usually just the posts and supports) will slowly merch with the trench. Every day, tighten the wire around the stakes, pulling the fence a little more upright. As the fence becomes straighter, add rocks in the trench and on the opposite side of the fence. When the fence has been upright for a month, with your adding rocks and smaller stones on both sides, you are ready to cover the rocks with concrete, letting it see into the rocks until you have a shelf of cement in each side. Let that settle for a month, and only then should you remove the stakes, wire, rope, and other outside supports.
There are faster methods, but this one should last a long time. Best wishes, Iri. ☺️