Boiling is a very effective means of disinfecting water. Boiling is when the water releases "visual vapors", you "hear a sound" coming from the pot/can and when you look inside you can see "bubbles popping" to the surface of the water. Boil for at least five minutes. Make sure the water is actually boiling - a rolling boil with big bubbles coming up and shaking the pot/can. Don't worry about over boiling, it's better to let it boil too long rather than not enough to make sure all of those harmful micro-organisms and contaminants are killed. To be safe, boil for at least 10 minutes at high altitude. Water boils at lower temperatures at higher altitudes.
Let the water cool before drinking. Boiled water tends to taste flat. It will taste better if you put oxygen back into it by pouring the water back and forth between two clean containers.