Perform well on the the SAT or ACT exams. Take a preparation course and study the tests with every bit of free time you have. You will want to score as high as possible in order to make up for mediocre grades. All UC schools look at both grades and test scores to figure out how well you perform academically.
Spend time writing a detailed and articulate personal statement. Play up any of your strengths that aren't shown on paper. The personal statement is the place to sell yourself to the university by downplaying your academic struggles and highlighting the other areas where you excel.
Show tangible improvement in your GPA. If you struggled your freshman year, but have steadily improved since, it could boost your chances.
Become a California community college transfer to the UC. Transfers from California community colleges enjoy an advantage in the admissions process over students from other four-year colleges and out-of-state students. Most transfer to UC their junior year. UC likes to see that you've been taking courses at the community college that could count toward your major, and that you've performed well in them. You must also fulfill general education requirements.
Take as many Advanced Placement courses and other academic courses beyond the basic requirements as possible in high school. Focus on one subject and perform very well in it. If you struggle with English but are good at math, become a math whiz and take as many advanced courses in the subject as possible.
Focus on special projects or activities outside of school, such as athletic endeavors or theater arts. If you aren't a great student, but have a talent for the visual arts, for example, you may gain acceptance. Even if the activities aren't school-related, they still will bolster your case. Schools want students who can enrich the campus life, even in non-academic ways. Volunteering is a great way to demonstrate this trait.