Any suggestions on how to train myself to do pull-ups?

Yes, first thing is work on form so make sure when you are in the hang position that your scapulas are set and flexed, your grip should be high up on the bar so you are not just using your fingers. First work on your volume, then refine your form. If you can’t do more than 5 pull-ups then I would also recommend using a resistance band by wrapping it around the bar and placing your foot in the band