Questions & Answers about J’y pense quand je marche au bord de la mer.
Here y replaces à cela, à ça, or à quelque chose.
The verb pattern is penser à + thing = to think about something.
So:
In your sentence, y does not mean a physical place. It stands for the thing the speaker is thinking about.