A warning is a caution against something dangerous. When there's a shark warning at the beach, the lifeguards will order everyone out of the water.
When you receive a warning, you get an official advance notice of some impending problem. A crow might caw loudly as a warning when it sees a cat, and a traffic cop might give a first-time speeder a warning instead of an expensive ticket. You can also use warning as an adjective: "The warning light came on in her car as it started to overheat."