Merely means "only." If you say "I was merely trying to help," your efforts were probably not appreciated and you're likely to be stalking off with your nose in the air.
Merely comes from the Latin merus, ("undiluted"). But "undiluted" is positive — as in, "that's the undiluted truth" — in a way that merely is not. When you use merely, it always has a negative, disapproving tinge to it: You might say, "She was merely a minor player in that drama," but if you said, "She was merely the star of the show," you would mean it ironically, since being the star is the most important role.