There are plenty examples available online, here's one of mine: https://www.michev.info/Blog/Post/2250/generating-a-report-of-users-group-membership-memberof-inventory
If you want a quick one-liner instead, use this:
Get-Recipient -Filter "Members -eq 'CN=user,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=EURPR03A001,DC=prod,DC=outlook,DC=com'"
where you need to provide the DistinguishedName of the user.