This is a bit difficult to answer without knowing more about the circumstances of the deaths, particularly how the fish looked when they died, but there are several possibilities.

The first of these is that you bought fish who were already ill. Sadly, even with good fish shops, this can happen. If so, you may have disease organisms remaining in your aquarium where they could have infected your new fish. This leaves you with two choices - empty the tank completely, throw out any plants, sterilise the gravel and equipment (boiling is the easiest way to do this) and start all over again, or treat the tank (whilst there are no fish in it) with a general purpose antibiotic, hoping to kill off whatever is causing the problem. I recommend Paraguard for this, as it will also help to bind up any toxic heavy metals in the water.

Even though you had your water tested it's possible there is a problem there. It's always better to do your own water testing and to make sure you can understand the results. Read our articles on Aquarium Water Parameters, Water Chemistry and Water Quality for a basic guide. Even if this doesn't help you now it may help to prevent future problems.

It's also possible that your fish died as result of stress caused by the way they were transported. Sometimes this happens as they're moved to the shop and there's nothing you can do about it, but you should take every possible precaution when transferring new fish to your home - see our article on Transporting Fish. Most importantly, you must make sure they have time to adjust before entering the aquarium itself. You can also take steps to minimise stress in the aquarium by making sure there are plenty of hiding places available.

Finally, it's possible that your fish weren't getting suitable food. Sometimes stressed fish won't eat and sometimes fish are confused by being offered a new type of food when they're used to something else. Ask your local fish shop what they feed to fish there and try using the same thing, at least for the first few days. Make sure it all gets eaten up.

When you are ready to try getting new fish, I suggest that you pick a hardy breed such as danios or barbs and get just a few to begin with (enough for a shoal in which they'll feel safe). Don't try to stock your aquarium all in one go, but introduce fish gradually in order to keep things stable.

Good luck!