Saltwater fish are well-adapted to their aquatic environment, which tends to have similar compositions around the world. Ocean water has more chemical components than just hydrogen, oxygen, sodium and chloride -- and so should your saltwater aquarium. To keep saltwater fish at home, you need a basic understanding of this water chemistry.
Salt is not the only thing in saltwater, but it is the most important. "Specific gravity" is the measure of the amount of salt in the water. The vast majority of saltwater aquarium fish come from water with specific gravity between 1.022 and 1.025. Marine salt is not the same thing as table salt. Aquarium salt has other dissolved minerals in it. Fortunately, most brands of aquarium salt preparations have everything your fish need. It's important to stick with one brand; fish don't adapt well to changes in their water chemistry.
In addition to salt, seawater includes dissolved calcium. Many invertebrates, such as coral and crustaceans, use this calcium to grow their shells and their support structures. They can take so much calcium out of the water that you need to supplement it between water changes. You can use liquid additives and calcium-rich substrates to replace this calcium. Many calcium products have a high pH, so be careful adding them. A calcium reactor can help dissolve calcium without disrupting other water parameters.
If you have a fish-only tank, or invertebrates without hard calcium structures, you probably have all the minerals you need in your commercial salt mix. However, some invertebrates need other trace minerals and may need supplements. Crustaceans need extra iodine when molting. Corals need magnesium to metabolize calcium. You can get such supplements at fish supply stores or online.
The water in your aquarium might need some chemical assistance to be safe for your fish. To make your salty mix, use reverse-osmosis water or distilled water. If you must use tap water, treat it with a dechlorinator at least two days before adding the salt mix. When it's time to add water to your tank, you don't need to dechlorinate it if it's 10 percent or less of the tank's volume. Large water replacement treatments will require dechlorination if you use tap water, so work an extra couple of days into your timetable.