At the risk of naivety, I ask, what role(if any) in a typical organization/company would be a "Friend" to an employee?
Labour union and other staff representation
In many workplaces, there are organised systems in place for the representation of employee interests. In some countries, this is mandated by law, at least for employers over a certain size. This may be a formal council elected by employees, it may be a union representative, or a less formal representation. It might be called Personalrat, Betriebsrat, Works council, ondernemingsraad, staff forum, staff council, union representation, or be known under a different name. If they exist in your workplace, they should have made themselves known in some form or another.
If you don't have such a representation, you may want to organise one. You may want to consult with the law in your country; in some countries, it's completely legal to fire people for no reason at all, including for organising. Your labour union can advice. As has been stated, HR is not your friend. But if you are in a conflict with HR, friends can be very helpful.
Labour unions are supposed to be your friend¹. Hopefully your labour/staff representatives are competent and clever, in which case you can't go wrong by confidentially talking to them (they may want you to be a member to help you specifically; you can't join an insurance after your house has burnt down either). It's possible that your labour union is malfunctioning in some way, in which case you might have to be more careful. There exist labour unions that are corrupt, run by organised crime, associated with a one-party state, or completely incompetent. If you live in a democratic society, you should be able to vote corrupt or otherwise bad union or staff representatives out of power; but if there is actual intimidation or totalitarianism involved, your problems are probably worse than a simple "HR is not your friend".
¹Friend in the meaning of on your side in a conflict, not personally.
Although this doesn't answer your literal question I want to say this about it. The phrase "HR is not your friend" just means that their interests don't necessarily align with yours. However there is nothing unique or special about that. Both inside and outside the worksetting there are a lot of circumstances where your interests conflict with the interests of someone else. For instance when the time has come to divide the inheritance of your parents even your siblings might not be your friends.
So although literally the phrase is true, don't let it's regular use on this site make you seeing HR-people as (potential) enemies. As I said before there are also (possible) conflicts of interest with your boss, direct colleagues and/or clients, in some cases even more so. I think it's physiologically too exhausting and counter-productive to see all these people all the time as (potential) enemies.
HR is generally on the company side. Their job is to protect the company based on policies and procedures. So they are "on your side" only if you fall within the scope of the policy they need to enforce (sexual harassment, etc). But in terms of you not liking someone or just disagreeing with someone, they're going to take the side of the company and state that the company's decisions are what need to be followed, not your personal grievances. After all, the success of the company is by what they can offer to their customers, not the fact that they resolved some issue between Rickka and his/her supervisor.
With that said, your "friend" is your resume. It's a powerful tool. When you submit your resume to a different company and turn in your 2 weeks notice, you're sending a powerful signal to your company that you are not in agreement with whatever issue you had. They may change or they may be glad to see you go. Either way you find a new job, new place, and hopefully have a better time.
I ask, what role(if any) in a typical organization/company would be a "Friend" to an employee?
Friendship is not achieved via a role.
Anyone at a company can be a friend. I've had friends in my department, friends who were my bosses, friends who worked for me, friends who were the CEO, CTO, CFO, CIO, etc., and yes - even friends in HR.
I could turn to any of those friends and have a confidential conversation that I knew would remain confidential. And I always knew those friends would be honest with me to the best of their ability, as I was with them.
In general, if you are friendly you'll have friends in many roles.
Anyone with a potential conflict of interest is potentially not your friend. And that includes almost everyone within your company and even outsiders such as vendors and clients.
And yes, even unions can side against you. I'm not saying this happens all the time. But if you don't have much seniority, or if you're not particularly pro-union, that can easily mean that your own interests can be diametrically opposed to what they advocate.
And yes, HR is not your friend, not just because it has a conflict of interest, but because first and foremost, HR is usually the unofficial fixer of the company. HR may pretend to be an impartial mediator that follows the law, but it can just as easily turn on you, help the company fire you, and help coordinate a cover-up. Protecting the company is indeed HR's primary function.
Your network is the informal set of people who have a positive impression of you and will listen to you if you approach them. These are the people you influence, and who influence you. They can help you answer work-related questions, help you with new job opportunities, etc. Networking is an important skill, but I'm not remotely the best person to ask about it, so see more posts on SE or the greater internet.
At work, even your friend is not your friend.
A friend of mine, "J", told me about an incident in her business. Her friend worked for her, and was making mistakes. J started leaning on her friend, and her friend said something to the effect of telling J to lighten up because they were friends. J responded NOT HERE, WE ARE NOT
While there is SOME overlap in real life, and you can be friends with people at work, they are your friends only if they are your friends, but there is nobody at work, who, by function of their position is your friend.
That includes any doctors you are sent to, including psychologists and psychiatrists.
Now, that is not to say that there are good resources to go to or use, but ultimately, everyone on the job is there to do their job first.