whirlpool refrigrerator defrost problem

The freezer is not defrosting properly, so the unit freezes up and causes the refrigerator not to cool. I’m not sure how to diagnose which part needs to be replaced.