What is a function? For the function to be a function it has to return something, otherwise is a procedure. Function is a semantic relationship between input and computed output.
Every time we execute the pure function with same inputs we absolutely and positively know that it will always return the same output. We want our function calls to behave as pure: every time we give it a same input we expect to receive the same output. The function call needs to avoid using side effects.
Impurity is about side effects. Minimize them. They impurify functional programming. Avoid them where possible or make them obvious in your code. How, you would ask? By taking away the impurity and writing a pure function that does computations and then a procedure to do the rest.
Making pure functions might not always be possible or practical but we should strive to extract impurity (side effects) and leave functions as pure.
It is possible that for whatever reason we cannot change or modify the impure function. Another option would be to contain the impurity so it doesn’t leek out to the rest of the scope. We can do that by wrapping an impure function inside a pure function. By doing that we reduce the surface area of that impurity and improve the overall program readability and maintainability.