Network Intrusion Detection Explained: How It Works, Types, Tools, and Best Practices