Cold emailing professors is one of the highest-leverage ways a high school student can get into real research. Most students never try, assuming a professor won't respond to a stranger, let alone a high school student. Reply rates are higher than people expect, as long as the email follows a few rules professors actually respond to.
Keep it short
Aim for 140 to 200 words. Professors often read these on their phones between meetings, and a long email decreases your odds of getting a reply, since they'll push it to later and often never open it again. Anything you'd want to explain in more detail belongs in a resume or a one-page project summary attached to the email.
Reference their actual work
"I'm interested in your research" gets ignored because it could be sent to anyone in the department. Naming a specific paper, project, or line of work tells the professor you did the reading. You should read a professor's specific work, reference it in relation to your work, and then attach a short summary of what you're working on.
Ask for a call before you ask for mentorship
Asking a stranger to mentor you is a big ask for a first email. Asking for 20 to 30 minutes to ask questions is small enough that it's easy to say yes to. The mentorship conversation, if it happens, comes after that first call.
Email the grad student or postdoc too
Professors are busy and slow to respond. Grad students and postdocs in the same lab reply more often and have more time to talk. Emailing both the PI and a junior member of the lab separately doubles your odds of hearing back.
Attach a resume every time
Even a short resume with your coursework, relevant projects, and contact information gives the professor something concrete to review rather than taking your word for your background.
Follow up once, then once more
If you don't hear back after five to seven business days, follow up in the same thread with something new: a result you got, something you read, an update on your project. If you still haven't heard back after another ten to fourteen days, send one last follow-up. If they haven't responded after two follow-ups, they probably won't.
Experiment with the times
If you get stuck in a phase with no replies despite sending lots of emails, change up the times you're sending them. Send some emails on Monday evening, some on Wednesday noon, some on Friday at noon. Informally collect data on which times work and send more emails then. You can use the schedule email feature in Gmail or Outlook to do this.