The way to have good friends is to be a good friend. Just like in most other aspects of life, the more you put into a friendship and are willing to put into a friendship, the better it becomes. A friendship doesn't have to be perfectly balanced, but it can't be one sided.
I've always felt blessed to have some very good friends, people I could count on for anything. I didn't truly understand why I had very good friends until I was well into my thirties.
My friend Jeremy asked me to me best man at his wedding. It was the third time I had been thus honored. I was happy, but surprised, because Jeremy had good friends from middle school, high school, college and military intelligence, that he had known for much longer than me. I told him I was very happy to be his best man, but wondered why he had chosen me when he had other friends he had known longer. He told me, I asked you because you are totally and utterly dependable. He said, I can always count on your help and don't have to ask. He said, I don't think there's anything you don't know something about and can't do and if there is, you can surely figure it out. Hearing that made me feel very good.
Afterwards, I talked to the other people I consider my best friends in life and they all told me pretty much the same things. I had chosen them because they were smart, supportive and dependable and they had chosen me for the same reasons.
I don't think you could truly fake being a good friend. To have good friends you need to genuinely care for, want to help and be there for someone. The other thing you need is the discernment to pick people who genuinely care for and will be there for you. There's a lot of users out there to avoid.
I have lots more, more casual friendships. Some are quite rewarding, but a good friend is a true blessing.
Keith