Everything I can to keep it alive. One great way to do this, is research your purchases. After diligent research, one can make a pretty good assumption wether or not they can keep them alive or not. But research is not enough by itself! Make sure fishes and corals show a good feeding response before purchasing. QT all livestock before placing in the display.
If you've got a fish thats "not doing so hot" as you put it, there are several things you can do. Is it not eating? try different foods! Remember, alot of these fish that are considered "difficult" are placed in that category because they won't eat in captivity. If the fish is sick, place it in the QT as soon as you see a problem developing.
I could go on and on as far as ethics/responsible reefkeeping is concerned, but this should be a good start for you!
kudo's to you for changing your purchasing habits!
Remember, RESEARCH,RESEARCH,RESEARCH!!!
good luck.