A tomato plant needs enough light and usable water to build both its leaves and its fruit. A lettuce harvest uses the leaves themselves. Both depend on the mechanisms you already know, but the part you want to eat changes the growing and harvesting decisions.
Timing matters too. A tender annual crop has a limited outdoor season, while a fruit tree may need several years to establish and begin cropping. Neither follows a guaranteed harvest date. Choose a small planting you can reach, water and revisit: one suitable container can teach more than a plot that becomes difficult to maintain.
Grow known edible crops from reliable sources, and check which parts are edible. Wash harvested fruit and vegetables with clean water before eating or preparing them, and wash your hands and preparation equipment. Cleaning removes dirt and reduces contamination; it does not make an unidentified plant or a poisonous plant part edible. Use the safety lesson when choosing the site and materials.