Make it easy to give you something usable. Asking for a testimonial invites a blank page and a delay. Asking three specific questions produces material you can edit: what was the situation before, what changed, and what nearly stopped you from going ahead. That third question yields the most valuable sentence, because a testimonial that names a doubt and resolves it addresses the objection your next prospect is holding.
Specificity is what makes them work. A quote saying the service was excellent could be attached to any business. A quote saying they were quoted three weeks and it took nine days is checkable, particular, and credible. Push gently for a number, a timeframe, or a concrete outcome, and edit for length rather than for polish.
Attribution matters more than the words. A full name, a business name, a role, and a photograph if they will allow it. Anonymous testimonials read as invented, and initials read worse than nothing. Always get explicit written permission for the wording you intend to publish, and show them the edited version before it goes live.
Place them where the doubt occurs rather than on a page called testimonials, which almost nobody visits. Next to the pricing, beside the contact form, and on the service page they relate to. A relevant quote at the moment of hesitation does work that a wall of praise on a separate page does not.
Keep the raw material as well as the published version. The full response to your questions frequently contains sentences useful elsewhere: a line for a service page, a phrase for an advertisement, a specific detail for a case study. Storing them in one document, with the date and the permission you were given, means you are not asking the same customer again in six months for something you already had.
Ask permission for the specific wording you intend to publish rather than in general, and keep the written reply. Somebody who agreed to a testimonial and then sees an edited version attributed to them can reasonably object, and a business displaying a quote it cannot demonstrate was approved has a problem that is entirely avoidable. Showing the final text before it goes live takes one message.