Take a deep breath and relax. Middle school does not last forever and not every girl you like is going to like you back. Anytime you flirt you are taking a chance, so accept that truth and try to have a good time.
Understand that not every person develops at the same speed. The girl you like may not be ready to date boys, which you should not take as a personal insult. Be polite and understanding if things do not go your way.
Try making yourself more noticeable before you start flirting. A girl should at least know who you are. Before you initiate your first conversation, start saying "hi" to her in the halls or smiling as you walk by. That way, when you do start talking, she will not think of you as a total stranger.
Think of some topics you have in common. Favorite bands, TV shows, or difficult class assignments are great conversation starters.
Compliment the girl during the conversation, but do not overdo it. Say something nice about her outfit or hair and move on.
Use your sense of humor and smile. If you seem like you are relaxed and having fun, it is likely the girl will pick up on those emotions.