For the apple tree, I would drive a sturdy stake in the ground a couple feet from the trunk, then make a loop around the tree and tie the end off to the stake, pulling the tree to straighten it up. You can do it gradually, not all at once if it needs to move a lot.