It's actually very simple. Give up what you desire. Stop clinging to it. “For whoever wants to save their life will lose it, but whoever loses their life for me will find it.”
For some, their life is their possessions as was the case with the rich man. For some, it's their family, “Anyone who loves their father or mother more than me is not worthy of me; anyone who loves their son or daughter more than me is not worthy of me.” For some, it's clinging to falsehoods, hence, the thief who could admit that he was a criminal (i.e. repent) was told, “Today you will be with me in paradise.” And so on and so forth.
As you can see, the path to salvation is truly narrow. And salvation simply means knowing God beyond any doubt. Why such knowledge saves, why that truth sets free, becomes obvious to you once you know Him.