When your tomatoes are starting to ripen, they might become heavy burdens for the branches to carry and stay straight, like these sad guys in the picture below.
This means your plants are in need of some physical support. To fix this, all you need to do is to insert a stick into the soil against the leaning plants. If the plants do not lean on the stick, use a string or similar kind to tie them together.
Now they look much more cheerful
This also works with any naughty plants that refuse to grow straight.