A filter circulates the water and, most importantly, houses the beneficial bacteria that run the nitrogen cycle; its biological role matters far more than simply making the water look clear.
Filters do three jobs: mechanical (trapping debris), biological (housing bacteria — the crucial one), and sometimes chemical (e.g. carbon). A filter should be rated for your tank size or a little above.
Common types are hang-on-back (HOB), internal, sponge (gentle, ideal for shrimp and fry) and canister (for larger tanks). Never turn a filter off for long or the bacteria begin to die.