Sadly, pests and diseases find vegetables as appetising as we do, and can affect some crops during their life. Ensuring your crops grow strong and healthy in good soil and aren't stressed by a lack of water and have the correct balance of nutrients will help reduce attacks. High nitrogen fertilisers can produce soft, leafy growth that is more prone to attack.
Some problems are specific to each crop, others will affect many types of vegetables. For instance slugs, aphids and whitefly will attack a wide range of crops.
Control varies from problem to problem, but identifying a problem quickly and dealing with it immediately will prevent the problem getting out of control. Crop rotation, for instance, helps prevent the build-up of soil-borne pests and diseases.
Covering plants with horticultural fleece (before the pests attack) will prevent some insect pests and birds reaching the plants. It's important to ensure the edges of the fleece are buried in the soil to prevent access and that the fleece is loosely held over the plants so that it can move with them as they grow. This is how many growers produce carrot fly-free carrots and cabbage rootfly-free brassicas.
In extreme case you may want to resort to using a pesticide. If you don't like using chemicals organic treatments are available.
In all cases, prevention is better than cure.