First off, I am assuming:
- it was a pretty big favor you did, something that would otherwise have been impossible, required an expensive professional, or was deeply meaningful
- the amount of money they offer is not close (< 1/5) to what they would have had to pay a professional but significant independently (not just pocket change)
This seems to me like they're offering you a "token of their appreciation".
It's a sincere sign of gratitude which doesn't try to minimize the value of the favor that was given.
If this is the case, then you will have to accept if they insist.
To do otherwise would be to say that you don't value their gratitude, and by extension, them - they are as beggars to you, less than children (since you would accept a little drawing, pretty rock, or flower from a child).
This is part of why people making this offer are so insistent - it can feel awful to not be able to at least express gratitude concretely.
But maybe those assumptions are wrong. In that case...
If the favor you did was minor and the amount of money offered is similar to the value of the favor, then you are mostly free to say no (unless they really, really insist.)
Be honest - "it was nothing", "you don't owe me anything", "I did it because you're a friend", "I'm sure you would do the same for me", etc.
If they insist, then you could simply suggest a minor alternative - "buy me a beer" or whatever is culturally appropriate.
The general rule is that you can offer a few refusals, but you pretty much have to accept a sincere gift that wouldn't be inconvenient to you (you can refuse a dog, a bulky cabinet, stolen goods, a piano, etc.)