Connect to Azure AD, MSOnline or Intune API with PowerShell

How to connect to Microsoft Azure Active Directory, Microsoft 365 or the Intune API through Microsoft Graph with PowerShell.