The right way depends on how close the answer was to completely solving your problem.
If it was very close, and you only needed to add a small step, suggest to the answerer that (s)he edits the last step in. If that is done, accept it. If the answerer doesn't react, if it is a small enough finishing touch, you can edit it into the answer yourself - but suggested edits tend to be rejected when they are substantially changing a post, so that route is only for really small finishing touches.
If the answer was sufficiently far away from completely solving the problem, but took you a long part of the way to the solution, answer yourself, giving proper credit to the first answer (upvoting it would be appropriate since it was helpful), and accept yours.
Where the line between almost complete and "sufficiently incomplete" is, must be decided by you, on a case-by-case basis, there is not one rule that fits all.