Navigating the Legal Framework of AI: A Comprehensive Guide