Egestion is the discharge or expulsion of undigested material (food) from a cell in case of unicellular organisms, and from the digestive tract via the anus in case of multicellular organisms.
It should not be confused with excretion, which is getting rid of waste formed from the chemical reaction of the body, such as in urine, sweat.
Egestion:-
Removal of undigested food or faeces from the gut. In most animals egestion takes place via the anus, although the invertebrate flatworms must use the mouth because their gut has no exit. Egestion refers solely to indigestible matter which is never absorbed into the cells - it should not be confused with excretion of the waste products of metabolism.
Excretion is the transfer of substances out of a living organism into its environment. At its simplest, for single-cell forms of life, this involves extrusion across the cell membrane of the unwanted or potentially toxic by-products of respiration and metabolism. This is also what is happening continually in the individual cells of the animal body, but from their immediate environment substances must move into the blood to be carried away to the site of their ultimate disposal. In the animal body there is also another type of excretion: expulsion of the residue of substances which have not been absorbed into the body proper from the gut (which can be considered a tunnel through the body of the external world).