It’s hard to determine how we know what is food for us. Certainly we have receptors in our nose and in our mouth that help us develop a catalogue of items that we can use safely. Since there isn’t always enough light to see or things may block our vision, a sense of smell can help in identifying things that may harm us. This mainly seems to be a learned behaviour in humans. Unlike many other animals if we didn’t have adults available to control our intake it is likely that we would eat harmful products.