You can change the UserType from a Member to a Guest (and vice versa) visually through the MSOnline Powershell module.
Install-Module MSOnline -Force
Connect-MsolService
Get-MsolUser
Set-MsolUser -UserPrincipleName <UserPrincipleName here> -UserType Guest
However, the UserType property represents the user's relationship to the organization. Therefore, you should change this property only if the relationship of the user to the organization changes. Otherwise it's recommended to delete and recreate the user.
https://learn.microsoft.com/en-us/azure/active-directory/external-identities/user-properties