Let’s say for some reason you don’t know the password for automation account, which is saved in your Azure tenant > Automation Account > Credentials.
This code will help you to get/read that password:
$cred = Get-AutomationPSCredential -Name <Name of your credentials>
$cred.GetNetworkCredential().UserName
$cred.GetNetworkCredential().Password
That’s it.
You can create new runbook with this code and run it.