Rather than Googling or copying\pasting the few lines needed to connect a PowerShell session to Office 365, just use this Module! Microsoft is moving away from this method of connecting to Office 365 via PowerShell, so I would check the PowerShell Gallery first to see if there are any other modules that already do this. For example Exchange Online Management is the new recommended way to connect to Office 365 via PowerShell when managing email related things. This is just here for any legacy reasons to connect to Office 365 via PowerShell while they still exist.
Connect-O365
or o365
then enter the username@domain and password for the Office admin account you are trying to connect to.
This module is not yet signed and uploaded to PowerShell Gallery, just download the folder from this repository and place it in a module folder.