First, you should decide what size tank you want. You will need a filter appropriate for the size of your tank. If you want tropical fish, you will need a heater. You should also do research on how to cycle a tank and set everything up before you buy fish.
When looking into buying fish first buy the tank and then set it up for about a week without and fish in it. The water need to grow bacteria before you can add fish. After about aweek buy some fish. You might lose 1 or 2. As well dont clean the tank to much. Maby 1 time a month.
The biggest piece of advice for buying fish is homework. If there is a certain fish you like research it. The more you know the better success you will have.
Whether the fish be fresh water or saltwater, make sure they get the right environment. Nothing kills a fish faster than using the wrong type of water.
You'll need to know what fish you want first.Then research what size aquarium you'll need, preferred water salinity/temperature, food, and what other species of fish can live with it.