One option is dig a hole deep enough to accommodate the rootball and stem, such that 6-8” of the plant remains above the soil. Another option is to dig a shallow trench for the tomato such that it can be laid in sideways.
When planting sideways, don’t bend the stem too hard trying to force it to point upward. As the plant grows, it will naturally reorient towards the light.