Decide on a topic that you want to write about. Describe a scene. Tell a story. Share an emotion. Make notes on this topic.
Write out two lines (sometimes called bars) about your topic.
Take the two lines that you have written and make sure that they are 14 and 13 syllables long respectively. Shorten or lengthen your lines as necessary.
Read your lines slowly and out loud. While doing this listen to see if every two syllables sound like this: da-DUM (like two beats of a heart). This is the sound of having unstressed and stressed syllables side by side, and is formally known as an iamb (or iambic foot). This is also the most common meter in rap lyrics.
Make notes about what you need to change to get your lines to fit the unstressed, stressed syllable pattern.
Make the necessary edits to your lines to get them to fit the iambic feet of the rap meter.