Mammatus clouds are a very interesting cloud formation that form in association with thunderstorms, but not exclusively. They can form with other cloud types as well as long as sinking air is present. You can tell you’re looking at a mammatus cloud because of the distinct bubble-like structures at the base of the cloud.
When you see a mammatus cloud in association with a thunderstorm, it is typically in the “anvil” portion of the thunderhead. This is the part of the storm at the top that flattens out and spreads out. The air up there is very cold and saturated. The heavy and dense air starts to sink. This air pushes past the cloud base and forms the bubbles you see at the base. These are mammatus clouds.
A big myth surrounding mammatus clouds is that it means a tornado is coming. Although these are sometimes associated with severe weather, they do not signify that it is imminent. They typically form under the overhanging anvil of a thunderstorm on the leading edge, but there is no basis to use these as a forecasting mechanism of either fair or severe weather. These can also form in other cloud types that produce no severe weather, rain, or snow.