It is best to follow a doctor's advice before getting a cholesterol test. This might include fasting or avoiding food for up to 12 hours beforehand. This helps to ensure the most accurate results, which can help to catch risk factors for heart disease.