Dead arm hang
The dip machine is the best, since you can gradually lessen your counterweight until you are able to pull up your body weight.
If you are at home with just the bar, the only thing that ever worked for me was progressive/inverse training starting with a dead arm hang: In the beginning use a chair, get your chin up there, and then just hold yourself up for as long as possible (probably 30-60 seconds.) Then, for each consecutive training session, after the static hold, you start lowering yourself an inch at a time, and holding the position for at least 5 seconds.
Eventually you will be able to take 2 - 3 minutes getting down- then you should graduate to your first pull-up. It will be easier in the beginning to assist yourself up (spotter or chair) and start from chin over the bar position. Eventually, you will be able to pull yourself up from a dead hang. From there, you just do as many as you can each training session.