Some sort of fencing for things like rabbits.
I usually just look for signs of pests and then treat with something appropriate which could just be manual removal with a last resort of Captain Jack's deadbug brew.
I always grow marigolds but I'm not sure if they work or not. The pests I get tend to vary every year but they mostly go after my kale. Agree with someone else that disease is your main issue with tomatoes.