Over a 3 day visit to Portugal we had to do a day trip to Sintra, about a 45 minute train ride from the center of the city. (Note, buy tickets at night when there is no line up — the Portuguese seem to enjoy lining up for a half hour to buy tickets!). From the train station you can start a hike directly toward to the castle (turn left from the train station). You can explore a lot of other places if you choose to take a “tuk-tuk” , these little golf carts that seat 4-6 and take you to the top and around, but we chose to get our steps in and do the hour hike through the forest path that leads to the castle.
As you get to the top, you’ll be asked to pay about 7 euros per person to get access inside the actual castle. It’s totally worth it and you can really get a feel for this place that was inhabited by various clans from 500 BC onward (The castle itself was built by the moors around 1100). https://en.wikipedia.org/wiki/Moorish_Castle
There’s not a lot of guardrails but you can avoid the treacherous parts if you like! Recommend!
Make a day of it if you really like history . . . otherwise a halfish day if you start early