This question is a bit vague. Is this the derailer that came with the bike? Is it the front or rear that you are having problems with? Is it indexed? These are all important questions. It is possible that the derailer is not designed for the number of cogs/chainrings you are running. When you say it doesn't shift onto the smallest ring/cog, do you mean that it doesn't go that far, or that when it does it rattles?
Regardless, derailers are tricky SOBs. Be more specific about what you are trying to do.