Well, it's not that easy. First, you need to be confident and have good communication skills. Also, try to be involved in different social groups at school to increase your chances of meeting the right person. But don't forget to focus on your studies too!
Just be yourself and be friendly. Join activities you like and you might meet someone with similar interests.
To have a boyfriend in high school, start by being genuine and kind to others. Try to be open-minded and approachable. Maybe join a club or sport you enjoy and you could strike up a connection with someone there. Just make sure it doesn't interfere with your academic goals.