Depends on the filter
If you have the replaceable cartidges, like penguin or similar, tear the fabric off the old one and cut a small bit, maybe an inch or so, then put that upstream of the new one.
Actually, you can even skip that if you do not clean the body of the filter at the same time you change the cartridge, for the bacteria coating the inlte tube and body of the filter will populate the new cartridge pretty quick.
With a whisper, you can cut some of the old fabric of the old bag and stuff it into the new bag, skipping the carbon unless you just want to polish the water to sparkling.
In general, do not clean tubing and replace media at the same time.
With sponges, you typically keep them for along, long time. If you must replace, just cut a small chunk and put upstream if you think you need to.