"... you will have treasure in heaven ..." (Luke 18:22)

"You still lack one thing. Sell everything you have and give to the poor, and you will have treasure in heaven. Then come, follow me." (Luke 18:22)

Does this mean we have to sell all our possessions in order to follow Jesus?

Here is how the conversation went, that prompted Jesus' response:
A certain ruler asked him, "Good teacher, what must I do to inherit eternal life?" "Why do you call me good?" Jesus answered. "No one is good—except God alone. You know the commandments: 'You shall not commit adultery, you shall not murder, you shall not steal, you shall not give false testimony, honor your father and mother.'" "All these I have kept since I was a boy," he said. (Luke 18:18-21)
Following this, we find Jesus was essentially instructing the man to give up his worldly life and dedicate himself to Jesus' teachings ("follow me").

Note that the man was seeking "to inherit eternal life." Would selling all his possessions and giving the money to the poor in itself provide this?

Rather, these instructions of Jesus are connected. How are they connected?

The first instructions Jesus gave him were to follow the commandments. These were spoken through Moses by the Supreme Being. By following those commandments, one can become prepared to make further advancement towards one's relationship with God.

Was the man already following the commandments?

According to the text, the man said he was. But Jesus wasn't only speaking to the man.

This brings us to an element often missed about Jesus' teachings: The scriptures are describing Jesus' teaching those around him. He taught different things to different people, according to their particular level of advancement, and according to the time and circumstances.

This is the case here, as Jesus understood that the man was significantly attached to his position and his possessions. He also had a sense of pride that he had been following the commandments. Therefore, Jesus' instruction was specifically intended to provide a challenge specific to this man's attachments and pride. Illustrating this, we find this next verse:
When he heard this, he became very sad, because he was very wealthy. (Luke 18:23)
Jesus gave him a choice, and he made it. But it wasn't as if everyone had to give up their possessions in order to become a follower or disciple of Jesus. For example, we find this verse in Matthew:
As evening approached, there came a rich man from Arimathea, named Joseph, who had himself become a disciple of Jesus. (Matt. 27:57)
Jesus instructed the man to sell his possessions because he wanted him to give up his attachments to his worldly life. Doing this would allow the man to step away from his false prestige - where he was the boss with lots of possessions.

Does materialism cause anxiety?

Yes, materialism produces anxiety because by nature we cannot control matter, yet we want to have more control. When we worry about things that we cannot control, we become anxious.

Materialistic attachments also distract from our spiritual progress. As such, material attachments create anxiety. There are three primary anxieties related to materialism, all produced by our lack of control over matter:

1) The anxiety caused by desiring what we currently don't possess.

2) The anxiety caused by fearing the loss of what currently possess.

3) The anxiety caused by losing what we lost.

These three types of anxieties can gnaw at us, sometimes at different stages at the same time. In this way, materialism can grab hold of us and keep us tied up: As we seek one thing while trying to safeguard something else, and regretting losing something else.

This can also take place with sensual things - and materialistic relationships. A boy might be desiring to have sex with a girl, or he might have a girl and be anxious about losing her. Or the boy might have just lost a girlfriend and is now mourning this loss.

By Jesus instructing the man to sell all his possessions, he was asking him to give up his materialistic attachments. This would allow the man to be able to focus on what Jesus was teaching.

What is our 'treasure in heaven'?

It is this connection that provides Jesus' notion of a "treasure in heaven." Simply selling one's goods and giving to the poor - or just giving one's goods to a charity today - cannot accomplish this by itself.

This would equate to us being able to buy our way into the spiritual realm. Just donating our possessions doesn't give us entrance to the spiritual realm. Nor can we buy our way into a relationship with God or Jesus with this or any other charitable activities.

Rather, Jesus was inviting the man to become his follower: He was giving him the opportunity to dedicate himself to the Supreme Being - by becoming a disciple of Jesus.

Why? Because Jesus is God's representative. He was sent by God to teach people, and guide people back to their innate relationship with the Supreme Being. Jesus clarifies that he came as God's representative multiple times, including these two clear statements:
For I have come down from heaven not to do my will but to do the will of Him who sent me. (John 6:38)
“My teaching is not my own. It comes from the One who sent me." (John 7:16)
Because Jesus is God's representative, by becoming Jesus' disciple, the man would essentially be dedicating himself to the Supreme Being. He would become a devotee of God. This would provide him with spiritual treasure. And by following Jesus' instructions, the man could accomplish the goal of life - love for God. This provides the linchpin of Jesus' teachings:
"'Love the Lord your God with all your heart and with all your soul and with all your mind.' This is the first and greatest commandment." (Matt. 22:37-37)