Cayenne pepper is ground dried chili from Capsicum annuum varieties, sold as a fine red powder. Its heat comes from capsaicin, and it sits in the moderately hot range, well above paprika and well below the superhot chilies.
Paprika is milder ground chili, sometimes smoked. Chili powder in many markets is a seasoning blend containing cumin, oregano and garlic alongside chili, so it is not a substitute. Red pepper flakes are crushed rather than ground and include seeds, so they distribute unevenly. Cayenne pepper is pure ground chili with nothing added.
In chillies and stews, marinades and dry rubs, sauces, roasted vegetables, and as a pinch in chocolate or hot drinks. Being a fine powder it disperses immediately and there is no taking it back out, so it goes in gradually. Blooming it briefly in hot fat deepens both flavor and color.
Airtight, dark and cool, and away from the stove, since heat and light degrade both color and pungency. Ground cayenne pepper fades over months rather than years, and a dull brown-red instead of bright red is the sign it has gone tired. Whole dried chilies hold their heat considerably longer than ground.
Capsaicin irritates eyes, skin and airways, so avoid touching your face after handling it, do not lean over a hot pan as it hits the fat, and use milk or oil rather than water if it gets on skin. Chilli can aggravate reflux, gastritis, IBS and ulcers for some people. Concentrated capsaicin supplements are a different matter to cooking with the spice, and labels commonly flag caution for anyone on blood thinners or blood pressure medication, or pregnant.