Technically, tomatoes and green beans can cross-pollinate. Realistically, due to the way the flower is structured, it’s unlikely to happen naturally. So, as long as you started with non-hybrids, you can get pretty pure seeds without worrying about it.
Those are the exceptions, though. With most vegetables the chances of crossing are a lot higher. The plants with nice big flowers like squash, you can tape a few blossoms closed when they’re just getting ready to open, then pollinate manually. I’m afraid I don’t have much experience with saving other types of seed from smaller-blossomed plants, I’m still getting started on seed saving myself. Still hoping the watermelon seeds I saved last year are fairly pure, they were Golden Midgets, which can get hard to find sometimes because they sell out so fast.
I should rephrase that, I didn’t mean to make it sound like beans and tomatoes could cross with each other, just that their unlikely to cross with members of the same species growing nearby.