I'm guessing the answer might lie between... everybody dies. or the planet explodes.
Let's say that somehow someway, all the pollution in the world just disappeared, along with the trash, oil and random junk that filled the ocean, as well as the all the sludge that filled fresh water sources?
Junk... is a lot of stuff. A lot, a lot of stuff. Pollution, oil, trash, junk - with all that gone, I'm guessing your oceans and waterways are now unlivable. The sudden loss of just the human made stuff might, maybe, somehow be survivable - wouldn't depend on it, we've been modifying the planet for a long time (both positively and negatively), and various species have been adapting to the new conditions, and may not survive the sudden reversion to the old.
But humans aren't the only life, and their (undesirable) products are really just as much trash or pollution as ours, we just notice it less. The sand on the ocean floor - "junk" or trash from shellfish, for example, but a real problem if it all vanishes. Dead animals are trash, right, but that will starve your decomposers and scavangers, and then work up the food chain as materials stop being recyclable and new "trash" can't be processed. Sludge probably contains lots of dead matter, minerals, and various nutrients for the decomposers, bacteria, algae, and so on and those effects ripple up and down the food chain (swamps are, generally, much more life-supporting than distilled water. Just sayin).
Oil - if it vanishes in water, why wouldn't it in earth? What would we do for power if it did? Pollution - well, again, there's the issue of suddenly changing the various chemical balances, but also - there's no real way of saying what is, or isn't pollution, what is, or won't be suddenly removed (recall the great oxygenation event killed lots of species, and wonder, wonder I tell you, if that will count as a very old pollution - it was created of life, after all).
Like I said, if we're talking about the "excess byproducts of life" as trash, most of the aquatic biosphere got zoinked. Terrestial ecosystems will follow soon, water is needed. If we're talking about non-recyclable "excess", several kinds of stone (calcium from coral or shells), or oil, are also such leftovers. Yanking great amounts of stuff, with no real idea what or which got yanked? Problem. Even limiting it to human-production, there's going to be so much collateral damage... I mean... who or what is saying which we need vs don't, which is good vs bad - usually something ends up being both in the end, or else the actual problem is in too much of something, not any-at-all, and so too much less is also a problem.
Let's also say, that all the previously dried up water sources, had been somehow magically filled with new water that is not of this world, but is just like the water of this world.
Um. So now there's magical flooding to go with the desertification of the existing water? Well, there's places that are dry, were once wet, and are now inhabited, and settlements flood and people drown. Or once dry places are now covered with other ecological growth, fields, forests, deserts and so on, which will now drown and throw surrounding ecosystems all out of whack. There will be dilution of water-ways where those old sources now have (dry) channels to existing water sources. Dilution of these existing waterways will probably disrupt ecosystems - not enough food in the water, not enough prey for predators, not enough sunlight (because the water is all deeper), not enough minerals, not enough salt. Life is kind delicate, since all the variations gave somebody or other advantages and disadvantages, and specialization is much less useful when conditions change drastically.
What if all the underground resources of this world all filled up again? Copper, Silver, Platinum, Gold, Uranium, Iron, Aluminum, Titanium, Chromium, Zinc, Diamonds and the many other resources there is.
Ok, so there is a sudden upwards pressure anywhere that was mined out, as the space beneath is suddenly filled. Collapsed places shoving back upwards, filled-in places bulging outwards, maybe scree or rock torn down to get at minerals rising upwards to reform cliffs or mountains. Roadways are often dug into roads to make them level, that would probably count as "mining" out rock, that being replaced would trap, crush, or kill many. Maybe the ground is buckling upwards on the surface because there was extra material (supports, infrastructure, fill in) that was trapped inside when this refilling happened. Maybe, in active mines... people were trapped inside, too. All gone.
Also, the pressure from displacing all the air in those hollowed mines probably causes a shockwave. The sharply shifting under-earth stresses (density, compaction, just movement) causes earthquakes,hills buckle upwards from pressure and maybe, with additional pressure or movement, mountains rise. Probably a fair amount of heat as a side effect, of the compression and energy and all the movement decaying into friction. Maybe volcanoes, depending on location, temperature, and the rippling of the crust. The planet suddenly got a bit more mass - maybe not much on the planet scale, but heck... the mass of everything that has ever been mined out, suddenly doubled as it was replaced in situ without vanishing from wherever it got moved too, that might be enough to set off some wobbling. I'd guess fluctuations in the magnetosphere and possibly tiny gravity fluctutations as the extra mass settles in.
Though for sake of just wondering, let's not include the amount of greed that humans have, and lets just say that they somehow take it as an act of god and decide to attempt to stop ruining their world, how would the environment change?
Would the planet get a lot colder? Would it get warmer for some reason? Would extinct species pop up again? Or perhaps new species will come in, or could the existing species flourish, due to the new perfect environment?
Act of God, yes. Humans stop ruining the world, yes, I don't think we'd survive. Environment changes, heck-anda-quarter, yes - the desertification of the waters, flooding, earthquakes, maybe volcanos or mountains rising. The environment will get a lot, hm, rougher, more chaotic, lots of species die, others adapt - this is an extinction event, here. I'd guess hotter, a lot more energy in the earth and water, a lot of movement as the extra mass balances out. No, extinct species won't pop up - time doesn't work like that, and neither does biology, though some of their traits might evolve back into usefulness and possibly similar species re-evolve. New species would definitely happen, and existing ones will become others, will split, will merge, will change dominance and survival strategies. You have created the perfect environment - to wipe out life as we know it and start again, to cause chaos, to bring change.
Not quite so perfect for surviving in, though.