Play an instrumental rap beat to give you an idea of how to fit your words into the beat and thus into bars.
Work out where the words will fit around the beat. The first and third drum hit in a bar will be a kick drum, and the second and fourth hit will be a snare drum, so try to punctuate your words around these measures.
Write some simple rhyming couplets to begin with. These are lines whose last words rhyme with each other. For example, in Dr. Dre's "Nuthin' But a 'G' Thang," Snoop Dogg raps: "One, two, three and to the four/ Snoop Doggy Dogg and Dr. Dre is at the door." Then you can choose to either keep the same rhyme sound for the next two lines or change for a bit of variety. Start by writing as many lines in this way as you can.
Start to introduce some internal rhymes once you've built up your confidence. An internal rhyme is when one or more words in a line rhyme with one another and with the last word of the sentence. Rapper MF Doom is one of the masters of internal rhymes, as you can see from this line from his song "Raid": "On one scary night I saw the light/ heard a voice that sounded like Barry White, said, 'Sure you're right'/ Don't let me find out who tried to bite/ They're better off goin' to fly a kite in a fire fight."
Practice writing and rapping over instrumental beats. To begin with, it's a good idea to borrow the rhyme scheme of one of your favorite rappers and try to change the words to help you get into a flow and get the idea of what constitutes a bar. Be assured that no rappers got to where they are without a long period of practicing their skills in a similar manner.