I don't think we have a sticky on this, probably should consider one; so I'll briefly explain (I hope
).
Hardness is the level of mineral and bicarbonates in water,and there are two aspects. GH refers to general hardness, principally the minerals calcium and magnesium though there are others, and the more dissolved minerals in the water the harder the water. KH refers to the level of bicarbonates, and while this is irrelevant to fish directly, the degree of KH determines the extent of "buffering" of the pH that the water will contain. The bicarbonates prevent the pH from fluctuating, up to the level of the bicarbonates. This is why adjusting the pH can be so difficult, and chemicals sold for this purpose should absolutely never be used in a tank with live fish. The buffering capacity of the water will return the pH and the fluctuating pH is more stressful on fish than a stable pH that may be somewhat outside the preferred range. A slight digression on pH, but it is important to know that they are connected.
The GH of water does impact the fish. Fish that are termed soft water come from waters that have very little (sometimes no) mineral content; they are--usually--also acidic. While some fish can adapt to harder water to a certain extent, especially if tank raised for generations, some do not. The dissolved calcium in the harder water can block the kidneys for one thing. Hard water fish, like livebearers, rift lake cichlids, and certain other species here and there, come from waters that have varying degrees of hardness. These fish need the mineral in the water in order to be healthy, and keeping them in soft water can be just as troublesome health-wise as keeping soft water fish in hard water. The two should never be combined in the same aquarium simply because the water will either be soft or hard, and some of the fish will be fine while the others will not, and this is stressful which leads to health problems, aggression, sickness, even death.
So it is important to know the preferred GH of a fish before adding it to your aquarium. "Compatibility" includes having fish that share roughly the same range in hardness and pH and temperature. As I said above, KH has no effect on fish (or plants), but it is relevant only with respect to the buffering capacity of the water. And this leads us to your question about changing the water hardness.
Soft water can be made hard fairly easily, simply by adding limestone, dolomite, marble, lava rock or crushed coral. Using small fragments of the former rocks (as in gravel) works better, but even a large chunk of limestone will slightly harden the water but slower than using the other substances. One has to be careful not to use too much, as the increase can be too sudden if there are fish in the tank; such adjustments should be done without fish in the aquarium, slowly and over several days and weeks. I mentioned pH being connected; as water hardness increases, pH tends to increase as well. So one must understand that raising the hardness is likely to increase the pH.
Softening hard water is more difficult. Peat can be used; it releases tannins that acidify and soften water. The harder the water, the more peat required, and the quicker it wears out. It also colours the water a yellowish-brown. It has to be continually replaced. This method works fine for small changes and in small tanks, but if the required change is significant, a better method is to use Reverse Osmosis (RO). This is a machine that removes everything from the water, creating basically "pure" water. The resulting water is then mixed with a bit of the harder water to restore some mineral and pH buffering.
If the KH is low, adding real wood to the aquarium can cause the pH to slightly acidify. This is not usually very significant, much like using the solid limestone rock to harden soft water. Also, with a low KH, the natural processes in an aquarium will slowly lower the pH as the water acidifies. But if the KH is high, it buffers this and usually the pH remains stable. Regular partial water changes are important for controlling this natural acidification and they tend to help maintain stability long-term.
Hope this explains it a bit.
Byron.