If a person could maintain his/her mind on what that should be taken in (kusala or moral) and those that should be gotten rid of (akusala or immoral)” daily without fail, that itself lead to the removal of greed, hate and ignorance. Nibbāna is removal of greed, hate, ignorance: “rāgakkhayō dōsakkhayō mōhakkhayō idaṃ vuccati nibbānanti“. - Nibbāna pañhā Sutta (SN 38.1).
In Sri Lanka, parents tell their child to clean his/her room by saying, “kämaraya (room) assa passa (or aspas) karāganna”. When cleaning the room, the child needs to get rid of the clutter (passa), but also can take in (assa) something like a flower vase to make the room look more pleasant, or to take in a chair that can be useful. So, one does not throw away everything or take in everything. One needs to be selective in taking in “good things” and throwing away “bad things”. That is where mindfulness comes in.
Similarly in the practice of Dhamma we should make a habit of taking in kusala & getting rid of akusala, or, equivalently, taking in the Noble Eightfold Path/discarding the miccā eightfold path, this eventually lead the practitioner to the getting rid of dasa akusala.
In the assāsa Sutta (SN38.5), it is specifically said what needs to be “taken in” (assāsa): “Katamo panāvuso maggo katamā paṭipadā etassa assāsassa sacchikiriyāyāti (what needs to be “taken in”). Ayameva kho āvuso ariyo aṭṭhaṅgiko maggo etassaassāsassa sacchikiriyāya (it is the Noble Eightfold Path that needs to be “taken in”). Seyyathīdaṃ (namely): sammādiṭṭhi sammāsaṅkappo sammāvācā sammākammanto sammāājīvo sammāvāyāmo sammāsati sammāsamādhi”.