Always check with your Human Resources Department regarding letters for non-selected candidates. There are many examples available through academic sites.
Selected examples:
Adapted from: Building Inclusive Libraries: Kindness, Equity, and Candidate Experiences in Hiring & Onboarding Toolkit (Grand Valley State University).