Chimneys must be cleaned at least anually, more often if the wood is not fully seasoned (completely dried). Burning unseasoned (green) wood causes creosote to build up faster.
Don't rely on commercial products that claim to clean the chimney or treat the creosote so it won't burn. There is no such thing. Creosote builds up over time and once ignited burns extremely hot. The only way to keep it from burning is to remove it from the chimney by scraping or brushing it out.
If you suspect a chimney fire,shut any air intakes and call 911. The time it takes to verify a chimney fire is precious time lost.
Safe disposal of wood fire ash is an often-overlooked fire prevention measure. Hot coals can survive for days buried in white ash, and their red glow is often not visible in daylight. When cleaning out a fireplace, wood stove, smoker, etc., that has been used within the last week, ashes should be moved to a metal bucket and water added to the bucket until the ash and water can be stirred like a soup. Yes, this is messy and a nuisance, but not nearly so much a nuisance as extinguishing a brush fire, making repairs to a building, or worse...