To have eternal life, know the commandments
A ruler asked Jesus what had to be done to inherit eternal life. Jesus said,
“You know the commandments: ‘Do not commit adultery,’ ‘Do not murder,’ ‘Do not steal,’ ‘Do not bear false witness,’ ‘Honor your father and your mother’” (Luke 18:20).
The ruler simply had to know the commandments and do them, or not do what the Lord forbid.
It is the same for Christians. Know the Scriptures and you will discover what the Lord wants you to do for eternal life.