A fruit is basically a reproductive part, producing seeds.
So, basically, if a specific plant part has seeds, or is a seed, then it's a fruit: avocados, peppers, squash, tomatoes, eggplant, green beans, pea pods, nuts, are all fruits
(of course there's some other complications, like seedless fruits, which is just a result of a few different things: selectively breeding for fewer Seeds, or harvesting before maturity, such as with zucchinis; if you leave them growing, they'll get absolutely MASSIVE compared to what you find in the store, but they'll be rock hard and filled with seeds)
Vegetables are basically any other part; roots, stems, leaves, etc
Botanical classifications are often completely different than culinary classifications. Here's another fun fact: strawberries aren't actually berries. But bananas are.