Butter, shortening, and margarine are all types of fats. You need to consider the type of fat they contain that when choosing the one that's best for your health and the one that's best for whatever you are baking or cooking.
Butter comes from an animal source, so it contains cholesterol and saturated fat. It is great for baking, as it adds nice flavor and great texture to cookies and pastries.
Shortening comes from vegetable oil, made solid by the process of hydrogenation. Because the oil comes from plant sources, it does not contain cholesterol, but might contain some saturated fat. It also works well in pastries and cookies, but doesn't add the nice flavor that butter adds.
Margarines vary a lot in the types of oils used, so you need to look at the labels. Those that contain higher amounts of fats are best for baking, as those with less fat will contain more water and will cause tougher baked products. Flavor varies with margarines, too, so you need to find one that you like.