use what the recipe calls for - some you can use margarine in place of margarine - some you can use only shortening - some call for just butter - some even call for oil - and some can be a combination of shortening and butter
if substituting butter for shortening - your cookies will turn out a bit different - of course butter is healthier for you because margarine and shortening are made with hydrogenated fat -
shortening will give you a cookie with a crisp edge and a chewy middle
butter makes your cookies crisper throughout and because of the moisture content in butter, the cookies will spread more during baking
if you prefer butter over shortening and you want a more cake-like cookie, add an additional egg or egg yolk to give you that texture