If you want to visit the Alhambra by your own means you have to book the ticket online from the official website:
They also offer to rent an audioguide from 6€: https://goo.gl/PVkRWz
The audioguide is also available in Android and iOS.
If you need to rent a car you can check our recommended car rental in Malaga
If you prefer a 1 day guided tour with ticket included then I recommend booking from this website: https://goo.gl/U4Zyy6