Not entirely sure what the ask is here? Can you please expand with additional details?
You can fetch the set of currently assigned licenses for a given user via a standard GET request against the /users/{userid} endpoint, which does also support filtering by license, if needed. As for removing an assigned license, the operation is pretty much the same as assigning one, but you only need to provide the GUID. To remove all licenses, you need to list each individual GUID, there is no shortcut option. If you need more detailed instructions, I have a sample script here: https://github.com/michevnew/PowerShell/blob/master/Graph_Remove_all_licenses.ps1