To calculate QALYs, two key components are considered: the life expectancy of an individual and the quality of life during those years. The quality of life is usually measured on a scale from 0 (representing death) to 1 (representing perfect health). For example, if a patient lives for 10 more years in a health state valued at 0.7, they would accumulate 7 QALYs (10 years * 0.7 quality of life).