First have your water tested by professionals, home testing kits are not very reliable. Do not rely on companies that sell water-treatment units to do the testing, their results may be biased. Ask your water company, health department, or local cooperative extension to run the tests for you. The type of system you choose depends on the problem you're having. The most common device is a carbon filtration unit.
Carbon filters are best for alleviating bad odors or taste from drinking water.
They also remove small amounts of chlorine, pesticides, solvents, chloroform, and other organic compounds that are hazardous to your health. They are also very effective in removing lead and inorganic salts. The draw back is that they are expensive to operate, they use a lot of electricity. However, they are cheaper to purchase than a reverse osmosis system. Reverse osmosis is excellent at removing inorganic compounds such as dissolved salts, iron, fluoride, nitrates, and heavy metals.