Of love and loving

I got a fortune cookie that says, “If you would be loved, love and be lovable.”

This is perhaps good advice but it is not entirely helpful to me.  I have a deep desire to be loved but have a very difficult time loving.  It is kind of a vicious circle for me.  I don’t know how to love so how can I be loved?

I hate this kind of thing.

How does a person learn to love?