Amazon sells nematodes that eat fungus gnat larvae. You basically buy a sponge with these nematodes in it, wring it into water, then water your plants with that water. I remember it being relatively cheap and lasting for 6ish months.
Add a lot of poo and compost. Dig out the area at least 1 foot deep, but 2 or 3 feet deep is best. We use an electric cement mixer to mix the poo (well-rotted farm animal), compost, and dirt (in equal parts; 1-1-1) and refill the area. We then use scaffolding boards to walk on so we don't compact the ground.
Tomato plants do best when they are planted deep. They will then grow roots from the stem/trunk.
Both lots of heat, so make sure you can provide that if you want to be successful.
Both are hungry feeders too. HOWEVER, do not use any product labeled "tomato fertilizer", unless it specifies early use. Use a general fertilizer for veg.
Once they start to flower, you then switch to "tomato fertilizer".
DO NOT water the plant itself as that will cause diseases and mildew. Water the ground and keep it evenly watered. Tomatoes will split if they get uneven watering.
If you are healthy or taking no meds, then you can give them pee once a week. You will need to dilute this to prevent burning the plant roots.
If you water in the evening, some plants can develop fungus or mildew due to poor circulation and prolonged moisture exposure. Early early morning seems to work well for me allowing water to evaporate off leaves before the sun gets too hot which could burn the leaves.
Since it's perennial, the roots will enjoy soaking up the wet fall and develop over the winter preparing itself for next summer. You might consider mulching around the base though if temps are going below freezing for prolong periods causing the ground to freeze too.