High school students can take classes at the community or local college as long as their enrollment is approved by an administrator of their school. These courses can be used for dual credits (college and high school). If the course is a college level course, depending on the number of units the course earns, a student could dually earn one year of high school credit towards graduation, upon completing and passing the college course. A course of this type can qualify as an AP class, or a university prerequesite. However, some universities have a policy which will not allow a college course, used for high school credit, to be used as a prerequesite. Talk with your high school counselor for more details.
There are a few steps a student needs to take to enroll in a college course. First, upon applying for enrollment at the college, there is either a form to be signed by the school administrator, or a letter, stating administrative approval, is required on school letterhead. Second, if the course is an English, math or science class, a student must take a placement test to verify the student's mastery level qualifies for the course. If the course requires a prerequesite course, that course must be taken before the desired class. In enrolling in a college course, returning adults have first chance at the class, first time adults have the second chance, and minors (high school students) have the third opportunity to take the class. In many cases, the class could be filled before the high school student is able to enroll. Don't give up, take some other class.
Consult with your high school counselor for more advice.