Random question about fetus

Po
So this is really random and I should probably know it...but how does the fetus "expel waste" from the nutrients it gets from us? Or does it just only take what it needs so there is no waste? (Sorry maybe too much coffee this morning...)