The hyperlink field object has the following property which is the Display Text of hyperlink field (with example value):
{
"desc": "SharePoint Patterns and Practices",
}
To reference the URL value, you need to use @currentField
.
For Your case you can use the following JSON to format your hyperlink column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField.desc",
"attributes": {
"target": "=if(@currentField!='','_blank','_self')",
"href": "=if(@currentField!='',@currentField, '')"
},
"style": {
"display": "=if(@currentField!='', 'block','none !important')"
}
}