For an account, you can list the available subscriptions using the command below:
az account subscription list --output table
It should output something like:
AuthorizationSource DisplayName State SubscriptionId
--------------------- ----------------------------------- ------- ------------------------------------
RoleBased Work Subscription Enabled 84ddb3d8-dujc-4fac-293s-cd80c0544223
Legacy My Azure for Students Enabled 234562c0-93jd-4231-ldww-efc461364a40
You can then set a subscription using the command below:
az account set --subscription 234562c0-93jd-4231-ldww-efc461364a40
The above command sets the current subscription as "My Azure for Students"