This question is one of the most pastoral questions I receive, and I want to answer it carefully because the wrong answer causes either false assurance or unnecessary torment.
The Bible gives us the answer in 1 John. John writes this letter specifically so that believers can know they have eternal life (1 John 5:13). He gives several tests.
First, the test of belief: Do you believe that Jesus is the Christ, the Son of God who died for your sins and rose again (1 John 5:1)? Genuine saving faith is not merely intellectual agreement — it is personal trust in a personal Savior.
Second, the test of love: Do you love other believers (1 John 3:14)? "We know that we have passed out of death into life, because we love the brothers." Authentic new birth produces authentic love for God's people.
Third, the test of obedience: Do you have a genuine desire to obey God's commands, even when you fail (1 John 2:3–4)? Not perfect obedience — but a real, heartfelt desire.
Fourth, the test of the Spirit: Do you have an inner witness that you belong to God (Romans 8:16)? "The Spirit himself bears witness with our spirit that we are children of God."
If you have placed your trust in Jesus Christ and see these markers — even imperfectly — in your life, you have reason for assurance.