I've often heard this as well, however, it can be really awesome to work with people you already know and like! From my experience, it's challenging due to mismatched assumptions and a lack of communication. The best time to clear this all in the air is at the beginning of the work relationship. It often means a direct conversation with the person you are wanting to hire.
A sample of the conversation might go like this:
Our relationship is super important to me, in fact, more important than you working here with me. I want you to be in the best role for your skills and ambition. If that's not here, then I want you to know that you can feel free to move on without me taking offense. However, it might become clear to me, that the role you're in isn't a good fit after working together, and I might have to ask you to vacate that role. I want you to know that it would be because I value you as a friend and as a whole person: I want you to be where you are best fulfilled and used.
Additionally, a lot of times when friends/family/etc. work together, there is this unspoken assumption that more grace is extended because of our prior relationship. While circumstances happen, I will expect you to perform at your highest level for the role I am hiring you for. Just because we're friends doesn't mean you get a pass. In fact, I would hope that our mutual respect for each other would mean that we work with excellence regardless of who is in charge.
Here is a clear job description with the roles and duties clearly laid out. This is what I am expecting you to be able to do...
It is my belief that a lot of times, the hiring manager of a friend thinks that they don't have to be as clear about the role since they are friends and "of course they'll work hard for me." Well, they might not know what you expect of them if you're not clear. That is true even if you aren't already friends: people generally can't read your mind! Expectations and feedback need to be clearly communicated.
Keep in mind that even with good communication and safeguards in place, the power dynamic will now shift, and encounters outside the workplace will invariably change. You are now their boss, even when just you're hanging out. You now see how they act through the lens of a supervisor (are they exhibiting good judgement here? Is this how they act at work towards others, towards customers? etc.) This isn't necessarily bad, but something to be aware about.