How to care for a lemon tree – 5 steps

I have had a lemon tree for 5 years, at first it flourished and bore fruit but after a couple of years
it blooms the same but does not bear fruit, the flower is lost and what would be the lemon remains but after a few days
what would be the lemon is also lost.
What do I have to do to make it work?
Thank you very much for your attention.

I live in Portbou Province of Girona and I am in front of the sea.