Does the expression "to do the necessary" (=to do what is needed) exist in English?
Yes. It is colloquial, and is used to save spelling out details.
In his declining years, he became incontinent. Each time we would do the necessary - it nearly wore the washing machine out.
Here, 'necessary' is used to mean what is obvious - they undressed him, cleaned him, changed his clothes and washed them.