It takes a lot of practice.
Is it original material, or a cover?
If it's a cover, try singing and playing along with a recording. It'll help ingrain the timing, and you'll likely find it easier to put the parts together when you have an audible reference.
Just make sure to practice without a recording, too.
For original material, if you can record just one of the parts absolutely perfectly, use that as a reference recording.