Apply the smallest change that fixes the root cause, preserving public contracts and every untouched line, then verify with the project's own commands. Use after the root cause and fix strategy are known, when it is time to actually change code in a repo you want to keep stable.