There is a Shuttle bus. According to updated RS 2023 Portugal pg 166 you buy tickets at the small hut next to the gate or ticket booth outside the main gate, cannot buy them online Or from the bus driver. There is a slight incline walking up from the shuttle up to the palace. May want to bring a hiking pole or cane.