When setting up your tank you need to make sure you have a filter, gravel (or approved sand), some aquarium plants, and possibly an airstone.
Turn on the filter and let the tank circulate water for two weeks before adding fish. Adding fish to a brand new tank will kill them. Also, you need to clean the gravel before adding it to the tank. The dust will lodge into the fish's gills and kill them.
Wait until the water is clear before adding your "scout fish" and let that one fish (usually a hardy one like a goldfish or a corycat) swim around for about a week before adding the fish you buy.
After you are sure that fish is doing well, and the other fish are doing well, make sure you change the filter once every month, change the water ever other week and feed your fish at least once everyother day (more is nice, but not so much that they won't eat it, since this can cause a bacterial build up.)
If you are using tapwater to fill your fishtank, the chlorine is probably the main reason your fish are dying. To neutralize the chlorine, buy some AquaSafe (regualr or for goldfish) and add it to the water. FloraPride helps keep your plants alive (they contribute to cleaning the water and providing oxygen for the fish.) Aquarium Salt can be bought at the store and this helps condition the water for your fish, Melafix is the number one thing to use when your fish get ill, and Prime should be used for water changes and whenever you start a new tank.
Also, check out http://tetra-fish.com/aquarium/default.aspx and have them send you weekly e-mails as reminders for taking care of your fish.
Other than that, there's not much you can do for them. If you bought saltwater fish, I recommend returning them immediatly, because they are the hardest fish to take care of and the water has to be PERFECT in order for them to survive. Making this water perfect can take up to two months depending on the size of your tank.
Just make sure your fish always look healthy, and try to get the care sheets from http://www.petco.com/CareSheets/CareSheets.aspx?Nav=154 and read the articels at http://www.petco.com/Content/ArticleTopics.aspx?PC=articletopic&Nav=153 whenever you think something may be wrong.
Good luck with future fish!