How do you make friends?

When i first meet a new person im very introverted but if they make the effort to be friends ill open up to them slowly and when i do im very talkative.

That methods gotten me some long term friends and it limits all the fake ones, however it gets lonely at times.