Things to remember
It's better to send a generic response than not reply at all. 63% of job seekers have a negative view of companies that “never responded.”
Respond as soon as you make a decision so you don't forget about it. You don’t have to remember everything, gather strength, call back.
If during the interview you realized that the candidate is definitely not right for you, you can make it easier for yourself: ask the candidate to call back in a couple of days and find out the result. So the task will not be forgotten and will not hang like a heavy burden.
With a mass selection, it is quite acceptable to warn applicants right during the interview: “If we did not call you back in two days, it means that they chose another one. Sorry for not informing you personally - we have a very large flow of applicants for this vacancy. Better to warn than to remain silent.
If the person went through the interview in several stages, send him a detailed answer. Simplify your work: ask to justify the refusal of the manager who took part in the interview.
Do not get personal, even if the person began to swear. Are you company representative. After giving the reason for the refusal, just end the conversation with the rude person.
How to refuse legally
The Labor Code of the Russian Federation regulates the legality of refusals to applicants in article 64 - “Guarantees upon concluding an employment contract”. According to this article, the refusal must be justified and related solely to the business qualities of the employees. Decree of the Plenum of the Supreme Court of the Russian Federation dated March 17, 2004 No. 2 “On the application by the courts of the Russian Federation of the Labor Code of the Russian Federation” explains what can be considered business qualities.

“The business qualities of an employee should, in particular, be understood as the ability of an individual to perform a certain labor function, taking into account his professional and qualification qualities (for example, the presence of a certain profession, specialty, qualification), the personal qualities of an employee (for example, the state of health, the presence of a certain level of education, work experience in this specialty, in this industry).

If the applicant, after the refusal, wrote a letter asking you to justify this decision, you are required to do this by law. If the applicant is not satisfied with the answer, he can go to court. Therefore, in the text of the vacancy it is necessary to indicate as clear as possible the requirements, and in the written refusal to indicate a specific reason, referring only to the professional qualities of the candidate.

The conclusion from the requirements of the Labor Code of the Russian Federation is simple: the best short reasons for refusal are “We hired a candidate with extensive experience” or “We hired a candidate with a specialized education.”

Letter or call?
It is more pleasant to report good news by phone. But it is better to refuse by letter.

Firstly, it is easier for the candidate to cope with emotions. He will calmly consider the refusal and, perhaps, send clarifying questions that will not come to mind in a minute of conversation.

Secondly, you will not tear a person out of the workflow: he will open the letter exactly when he realizes that he is ready to do it.

An easy way to respond to everyone at once is to send out template emails. In the employer's personal account on hh.ru, you can send out refusals with one click, without going into the resume, and change the response template for each new vacancy. How to write a rejection letter
The disclaimer text does not have to be "template". The secret of good writing is personal communication. Imagine that your friend should receive the letter, and not some conventional person.

Give thanks. As dry as possible: not just “Thank you for applying to the vacancy”, but at least “Thank you for choosing our company from hundreds of others.”
Justify refusal. Instead of "Unfortunately, we are not ready to make you this offer at this time," write a personalized answer for the job. For example: “Unfortunately, at the moment you do not suit us by experience. We are looking for a candidate who has worked for our competitors for at least three years and knows the market.”
Don't burn bridges. "We hope you don't mind if we save your response and get back to you if we have other suggestions."
Cheer up the candidate. If the candidate was interviewed, add a couple of truthful words about his good qualities: “The project manager was impressed by your commitment to learning. We are sure that after a year of practice you will be able to apply for the chair of the head.”
Leave your signature. Be a person to the candidate, not a mailing robot.
Just do it!
The worst option for refusal: to promise the candidate: “We will call you back!” - and do not call back. No one wants to do this, and everyone has more important and interesting tasks. But voicing a denial is important for three reasons:

failures are one of the components of the company's image in the HR market;
this is your image as a recruiter;
Finally, it's just your job.
Enter refusals in the job description, tell the manager that every Friday you will be busy answering candidates for two hours. Help others grow: A really good rejection tells the person what to work on and motivates them to keep growing. The number of people of working age is not unlimited oh, and if he gets the skills he lacks, he'll be a desirable candidate in a couple of years. Therefore, unless you are conducting mass recruitment for vacancies, recommend trainings, courses, and professional literature in case of failures. Let the candidates come back to you!