The purpose of life is reflected in the first two commandments: loving God, and loving your neighbor.
Loving God is keeping His commands and will cause you to know Him, and to love your neighbor.
Those are the two tests that must be passed to enter heaven:
Knowing Him is required:
Matthew 7:23 And then will I profess unto them, I never knew you: depart from me, ye that work iniquity.
Loving Others is required:
Matthew 25:41-46 Then shall he say also unto them on the left hand, Depart from me, ye cursed, into everlasting fire, prepared for the devil and his angels: For I was an hungred, and ye gave me no meat: I was thirsty, and ye gave me no drink: I was a stranger, and ye took me not in: naked, and ye clothed me not: sick, and in prison, and ye visited me not. Then shall they also answer him, saying, Lord, when saw we thee an hungred, or athirst, or a stranger, or naked, or sick, or in prison, and did not minister unto thee? Then shall he answer them, saying, Verily I say unto you, Inasmuch as ye did it not to one of the least of these, ye did it not to me. And these shall go away into everlasting punishment: but the righteous into life eternal.
Invest time in reading God’s Word and doing it. Talk to Him often and He will guide you to the path to knowing Him while providing His perfect love needed to love others.
Mark 12:30-31 And thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind, and with all thy strength: this is the first commandment. And the second is like, namely this, Thou shalt love thy neighbour as thyself. There is none other commandment greater than these.
Romans 2:13 (For not the hearers of the law are just before God, but the doers of the law shall be justified.
1John 2:3 And hereby we do know that we know him, if we keep his commandments.
Ephesians 1:17 That the God of our Lord Jesus Christ, the Father of glory, may give unto you the spirit of wisdom and revelation in the knowledge of him:
Jeremiah 9:24 But let him that glorieth glory in this, that he understandeth and knoweth me, that I am the LORD which exercise lovingkindness, judgment, and righteousness, in the earth: for in these things I delight, saith the LORD.
1John 2:5 But whoso keepeth his word, in him verily is the love of God perfected: hereby know we that we are in him.
1John 4:12 No man hath seen God at any time. If we love one another, God dwelleth in us, and his love is perfected in us.