Comprehensive Guide to Anomaly Detection: Preventing Cyber Threats