Use distinct variable names or refactor code structure.
To prevent shadowing, choose unique variable names or adjust scoping by extracting logic into separate methods. In a checkout process, use specific names like 'productTotal' instead of 'total' to differentiate between different parts of the calculation.