Aspects of the disclosure relate to a method for treating idiopathic pulmonary fibrosis (IPF) in a patient with N-acetylcysteine (NAC) comprising administering NAC to a patient after a sample from the patient has been genotyped and determined to be any one of: a) homozygous or heterozygous for a thymine at the single nucleotide polymorphism rs3750920; b) homozygous or heterozygous for guanine at the single nucleotide polymorphism rs5743894; or c) homozygous or heterozygous for thymine at the single nucleotide polymorphism rs35705950.