Find an instrumental that you like.
Find a beat that you can get into. Some individuals prefer something more melodic, while others like bangers. It's all up to you, and what sound fits you best. Experiment, or even go acapella!
Have a line in mind to start off with.
It's helpful to think of a word or bar to begin. You don't want to think of too much since that may get you confused and it defeats the purpose of freestyling. Just enough to get your flow going!
Think about some easy things to rap about.
Don't know what to rap about? Think about your day, what you've had to eat, people that you know, things that you like. There's no end to what you can rap about. Express & let it all out!
Start with simpler rhymes.
Go with one syllable rhymes at first, and as you get better, you'll start using more complex rhyme schemes. But start with the basics so you can work on following the beat!
Let one line follow from another, keep an open mind.
You want to follow the end of one bar to the beginning of another, let the words come naturally. Don't be afraid to change subjects or say something random...just keep going with the beat.
But feel free to think ahead as you rap.
While being natural is fundamental, you want to try to actively process future rhymes while you're spitting the current line. It's a bit of mental multi-tasking, so it may take some practice.
Which brings us to a very important point: PRACTICE.
If you want to get better, you just have to practice. The more you freestyle, the better you'll get. I started off not being able to go for more than two rhymes. You get better, and rap longer.
Don't be scared to mess up. Keep going when you do.
We all mess up, and there will never be a time where anyone is always perfect. If you mess up, don't get flustered - just start your next line. Laugh it off, take a second to get back into it.
Building confidence goes a long way.
When I started, I was super self-conscious. As you freestyle more, you'll get more confident - and get better as a result. I've found it helpful to rap with and in front of friends.
In the end, it's all about having fun.
Freestyling is a time to de-stress, let your thoughts come out. Don't worry about being judged, just have fun. Don't take it or yourself too seriously and throw down some dope lines!