You probably want to eat in the area around the entrance to the Alhambra and the car park.
If you wanted to go down into the centre of Granada you would need to catch a bus.
I go to the Alhambra several times a year and I have tried some places.
If you don't mind spending money the Parador has a good restaurant.
More info
https://granadamap.com/parador/indexsp.htm
If the weather is good there is an outside restaurant called the Mimbre.
There is a web page of it here.
https://granadamap.com/mimbre/
It's not very cheap.
Another outside place is the Jardines de Alberto.
When you come out of the Alhambra go down the hill about 60 metres.
It's opposite the ticket office.
There is a menu del dia and you can also choose from the menu.
https://granadamap.com/alberto/