In modern neurology or pharmacology, an agonist is a substance that works at the same receptor, or perhaps just works to the same ends, as a naturally occurring neurotransmitter in the nervous system. The definition of agonist, and its opposite, an antagonist, is fairly simple, although in practice things can be a bit complicated, since sometimes substances act as an agonist at one receptor type and an antagonist at another.
But an easier, and more important issue to clear up, is the etymology of the word "agonist", as well as its more common English derivative, "agony". "Agonist" is a Greek word that means "Competitor", and it is most commonly used in English in the words "Protagonist" and "Antagonist". A related word, "Agony", originally meant the act of competition. It then came to mean "The pain of intense competition", and finally came to mean "intense pain". This causes some confusion because the modern use of the term "agonizes" suggests something that neither the Greek term, or the neurological term, means. To say that a molecule of ephedrine agonizes epinephrine receptors is not to say that it causes pain, it is to say it acts positively at that receptor. With understanding of this terminology, much pharmacology makes much more sense.