As muru says, this is up to you.
If you're looking for criteria for accepting answers suggested in official resources, there's What should I do when someone answers my question?:
Choose one answer that you believe is the best solution to your
What does it mean when an answer is "accepted"?, also in the help center, weighs in on this too:
Accepting an answer is not meant to be a definitive and final
statement indicating that the question has now been answered
perfectly. It simply means that the author received an answer that
worked for him or her personally.
I also quite like Oli's recommendation:
Try to accept whatever has helped you the most. That's what it's
supposed to mean but it's really down to your interpretation.
With all that said, I will lightly suggest a possible "procedure" for figuring out what answer to accept. This is more a list of things to consider than a real decision algorithm, and I'd urge you to take it with a grain of salt -- it's about as far from official advice as anything can get.
- Pick the answer you consider best, if any.
- Otherwise, pick the answer that helped you the most, if any. (Which answer did you end up using? Or using the most? Or liked best when you used it?)
- Otherwise, pick the answer you think will be most helpful to people in general, if any.
- Otherwise, pick the answer you want most people to read first. In the default ordering of posts, the answer you accept will be shown above other answers, even if the other answers have a higher score. (Unless the answer you accept was written by you, in which case it will still be shown below answers with more votes.) I understand that, in practice, this might not really be independent from the first three criteria. (But see #7.)
- Otherwise -- and I emphasize that this is if you really do strongly feel all answers have equal merit -- pick an answer that, while fully generally useful, might otherwise be overlooked, if any. This might, for example, be an answer that has fewer votes and thus displays low on the page. Or, if you don't feel good about that, and you want to slightly magnify the power of the community, pick an answer that voters have smiled upon by upvoting highly, if any.
- Otherwise, there's really nothing about the merits of the posts to choose from. Do you slightly like one more than another but you can't put your finger on it? Go ahead and accept that one! Or flip a coin, roll a die, run
shuf -i 1-N, or the like. If the order it gives you suddenly feels not quite right, then maybe you do have the means to choose a best answer after all.
- All else being equal, if you have answers that are equally good by whatever measures you choose to consider, and a really long answer has the most votes, then you might want to accept a shorter answer so that at least two answers are visible to most users who view your question. If you're in a situation where you can't go wrong -- where you can't even go less right -- because all the posts are equally good, then I think it's reasonable to accept with a view of making it easier for readers to notice and browse between questions on the page. (And yes, I do appreciate the irony that #7 might tend to cause my own answers to be accepted slightly less often. :)
I reiterate that this is more food for thought than something I'd suggest actually following step-by-step.