Hammer the stake about 18 in (46 cm) away from the tree and 18 in (46 cm) into the ground at about a 15-degree angle away from the tree.   You can use a pickaxe to get the hole started, or wet the ground with a hose first to soften it and make it easier to pound the stake in. Avoid damaging the roots when placing the stake. You can buy stakes made of treated wood at a garden store or home improvement center. The stake should be about 3/4 of the height of the tree, and can be about 2–4 in (5.1–10.2 cm) in diameter. This method will work for trees that are of a size you can straighten by pulling on it with your hands. If you cannot move the tree with your hands, then you will need to use another method to straighten it. Use an old piece of garden hose or get a piece of rubber hose at a hardware store. Feed the ratchet strap through it until it is in the middle of the strap.  Make sure the piece of hose is long enough to wrap about 3/4 of the way around the trunk of the tree to protect the bark. You can use wire fed through a piece of rubber hose as well, but a strap with a ratchet is easier to tighten. Straps with ratchets are available at home improvement stores, or you can find special tree straightening straps at a garden store. Don't use wire or tight rope as a tree strap as these will damage the bark and potentially kill the tree. Wrap the strap around the side of the tree that is leaning towards one direction. Place it about 18 in (46 cm) high above the ground. Pull the loose ends of the strap towards the stake. If the tree is particularly small and flimsy, then place the strap closer to the ground wherever it seems more stable. Pull on the tree with the strap gently to make sure the tree can still stand on its own under pressure. Tie the loose ends in a tight knot around the stake. Ratchet the strap until the tree is standing straight. Don’t tighten the strap so that the tree cannot move at all. You want it to be able to move a bit in the wind so the roots grow strong. Check on the tree at least once a week and take slack out of the strap. This will keep the tree from leaning again and help it to grow straight. You should also check on the tree after any big wind storms to make sure it is still held securely in place. Loosen the straps a bit at first to make sure that the tree is standing straight. Take the straps off completely when you see that the tree can stand straight on its own.  A growing season is the period of the year during which trees and other plants grow the most. Usually a growing season is about 90 days long, but can last for a whole year in tropical climates. You can start the staking process at any time of the year, but make sure to let the tree pass through a full growing season before you remove the strap.

Summary:
Pound a stake into the ground in the opposite direction than the tree is leaning. Feed a ratchet strap through a piece of rubber hose. Wrap the hose around the back of the tree and pull the strap to the stake. Tie the strap around the stake and ratchet it tight. Monitor the tree and tighten the strap when it becomes loose. Remove the straps and stakes after 1 growing season.