Castello del Miramare can be reached by taking either the 6 or 36 bus, and the rides are worth taking even if you don’t end up at the castle. The 36 makes a loop, staying always along the water. When I went, the grounds were closed, but I had a walk along the sea. The outskirts of Trieste are all sea and sky, with clouds piling up as if to compete with the sea.
This is the closest I got to the castle:
And this is the cloud formation I saw when walking back:
The 36 whisked me back into town when I’d soaked in as much sea as possible without diving in. The bus rocked from side to side mimicking the ocean waves on the way back to Trieste.