They say that all writers are good readers. Same with rap: all the authors of their own songs must first become good listeners of someone else's creativity. To create your own rap song you need to listen to many songs by recognized masters. And not just listen and repeat them aloud, reciting over and over again, to catch the rhythm. After such training, writing will become much easier.
You need to decide the topic you want to write a song in style rap. Do not just think about the rhyme, it doesn't always come immediately, and that's just frustrating. Just need to write down all your thoughts about your loved one, if the song be dedicated to him, or in relationships with friends, or unfairness of life in General. When the text is written, you can try to put it into rhyme.
Ask your friends, preferably also rappers, to play with you in battle. It's a battle, a verbal duel in which the opponents take turns to spread rhymed lines under a predetermined rhythm. Improvising is easier when the two of you, and the competition spurs the imagination. If you're scared then forget what you read on battle, record on the recorder.