The word "never" means that you never give up until you achieve your goal. But yet there are situations when it is actually better to give up. Whenever you realise that in the process of achieving your goal you are causing harm to others then stop immediately and reassess the whole situation. Have a look if you could redefine your goal from being egoistic to a goal which serves the best of all.
If you realise during the process of achieving your goal that you have made a mistake and later corrected it than it is okay. But if you realise that you are making mistake because your goal is purely egoistic and yet you persist on achieving it, then you are completely fucked. You are creating consequences for yourself and for the others. Temporarily you would think that you may escape the consequences but eventually they will get you and then you realise that achieving your egoistic goal was not worth it. But then it will be too late and you will have to walk through the consequences which are not pleasant at all.
But what about if you are 100% certain that your goal is best for all but yet you find yourself in a situation when you haven given up ? Well... this happens only whenever your starting point is of ego. The goal itself is best for all but still your process of achieving it has personal and egoistic intentions within it. And when somebody challenges your ego, then the first reaction you will have, is wanting to give up. And if you don't realise it and continue defending your ego then the result of it will be giving up and being angry with those who challenge the ego.