Mechanical filtration: straining out solids from your water, for example having the water run through a filter pad, which catches anything that's not small enough to pass through it's fibers. Every now and then the filter pad is rinsed to remove the particles caught in it, and when it gets gunky enough, replaced with a new one.
Chemical filtration: removing chemicals from your water, for example using activated carbon in your filter, which is useful for taking medications out of the water after you've finished a course of treatment.
Biological filtration: growing a culture of beneficial bacteria, which is essential for a healthy tank. Fish produce ammonia as waste, which these beneficial bacteria use and neutralize, so it doesn't build up and become toxic to your fish. Water running though a media with a large surface area, such a filter sponge, create a good environment for the good bugs to grow and thrive. It takes a while, usually a few weeks, for a good colony of bacteria to build up in the filter when you have a new set-up.
Example of one of my filters (a Penguin 330): first the water passes into a chamber where there are 2 baskets filled with sintered glass balls, a media for growing good bacteria. Then the water passes through 2 frames covered with filter padding for mechanical filtration. These can be filled with carbon for chemical filtration when needed, or carbon can be put into the baskets with the sintered glass. After passing through the filter pads, the spills out of the filter back into the tank, turning 2 bio-wheels in the process, for more biological filtration. Bio-wheels are made out of a special material that makes a good place for bacterial growth.
Goldfish are very messy fish and need at least 10x the amount of water in your tank passing through the filter per hour. That means if you have a 50 gallon tank, you need 500 gallons per hour of filtration, minimum. Filters tell you how much they filter per hour. For example, my Penguin 330 filters 330 gallons per hour. Having the proper filtration on your tank will make a HUGE difference on how easy it is to keep your tank clean and your water parameters good. I like to have more filtration on my tanks than the minimum; I have 330 gph on my 20 gallon tank, and 716 gph on my 50 gallon.
Hope this helped a bit with understanding filtration! I took me a while to understand it too when I first learned about it.