Insomnia is defined as difficulty initiating or maintaining sleep, or both, despite adequate opportunity and time to sleep, leading to impaired daytime functioning. There are two types of insomnia: primary insomnia not associated with any other condition, and secondary insomnia caused by another condition like depression. Insomnia can be acute (lasting 1-3 weeks) or chronic (lasting over a month at least 3 times a week). Chronic insomnia is treated with relaxation techniques, sleep restriction therapy, and medication, while acute insomnia may not require treatment. Good sleep habits like regular sleep schedules and avoiding stimulants before bed can help treat insomnia.