Very good question.
You have read the verse below.
Based on this entire Text:
John 15:4
Abide in Me, and I in you. As the branch cannot bear fruit of itself unless it abides in the vine, so neither can you unless you abide in Me.
The fruit is love, joy, peace, e.t.c.
So one must believe in the death and resurrection of Jesus Christ, in order to receive the Holy Spirit. The fruit of the Holy Spirit is then available to be enjoyed and given to others.
If the branch does not bear fruit, then it is in real danger of being cutoff and burnt.
As the verse above says, 'the branch cannot bear fruit of itself'.
Jesus Promises the Holy Spirit
15 “If you love me, keep my commands. 16 And I will ask the Father, and he will give you another advocate to help you and be with you forever— 17 the Spirit of truth. The world cannot accept him, because it neither sees him nor knows him. But you know him, for he lives with you and will be in you. 18 I will not leave you as orphans; I will come to you. 19 Before long, the world will not see me anymore, but you will see me. Because I live, you also will live. 20 On that day you will realize that I am in my Father, and you are in me, and I am in you. 21 Whoever has my commands and keeps them is the one who loves me. The one who loves me will be loved by my Father, and I too will love them and show myself to them.”
22 Then Judas (not Judas Iscariot) said, “But, Lord, why do you intend to show yourself to us and not to the world?”
23 Jesus replied, “Anyone who loves me will obey my teaching. My Father will love them, and we will come to them and make our home with them. 24 Anyone who does not love me will not obey my teaching. These words you hear are not my own; they belong to the Father who sent me.
25 “All this I have spoken while still with you. 26 But the Advocate, the Holy Spirit, whom the Father will send in my name, will teach you all things and will remind you of everything I have said to you. 27 Peace I leave with you; my peace I give you. I do not give to you as the world gives. Do not let your hearts be troubled and do not be afraid.
28 “You heard me say, ‘I am going away and I am coming back to you.’ If you loved me, you would be glad that I am going to the Father, for the Father is greater than I. 29 I have told you now before it happens, so that when it does happen you will believe. 30 I will not say much more to you, for the prince of this world is coming. He has no hold over me, 31 but he comes so that the world may learn that I love the Father and do exactly what my Father has commanded me.
Jesus seems to be emphasizing that if you obey Him The Holy Spirit shall come. The Last two verses make absolutely no sense to me.