What does it take to earn God's forgiveness?

Each answer is quoted as it is from the commentary of the Quran, with the passage it comes from.