Office hours are a complement to both lecture and recitation. Whereas lecture and recitation are structured by way of large and smaller groups, office hours are conducted on a 1:1 basis, and offers more opportunity to focus on students' individual needs.
WHY attend office hours?
Obtain clarification on concepts, facts, and processes gone over during lecture, recitation, or homework.
Obtain clarification on formulas, applications, and specific problem set areas gone over during lecture, recitation, or homework.
Coordinate with the professor or recitation leader to make up tests, quizzes, or other work you might have missed during absences.
Check in on how you're doing in class: while you should be keeping track of your grades on assignments and assessments, your recitation leader can provide feedback on your participation in lecture and recitation, and discuss any patterns s/he notices regarding your strengths and weaknesses on concepts.
Connect and build relationships with faculty, particularly if s/he specializes in your major, or is working on projects that could serve as potential UROPs. Whatever lies ahead in your college career and beyond, establishing mentorships with faculty can help secure meaningful recommendations, and provide helpful advice for future endeavors.
HOW can I prepare for office hours?
Confirm where and when you're meeting, and be sure you've mapped out how to get there.
Know the professor's academic background and current research: reading up via a departmental faculty web page and using your knowledge during office hours will demonstrate interest, help connect with the faculty member, and even pique your own curiosity.
Bring appropriate materials: if discussing a problem set, for instance, be sure not only to bring the problem set, your work, and answers, but also notes from class on the relevant concepts, and perhaps even the reading that pertains to it.
Write down questions and discussion points beforehand, even if discussing one problem from a problem set. For instance, you might have specific questions about one aspect of the application of a concept or formula, or are unsure about one particular process in a problem. Articulating these questions beforehand will ensure a smoother process during office hours.
Know what office hours are not, i.e. a time for lecture recap; is clarification, not a recapitulation.
HOW can you maximize the meeting as it's occurring?
Manage your emotions: meeting a professor one on one may be a new experience, but will work best when nervousness, anxiety, and apprehensiveness play as little a part as possible. Even if communication does not end up being ideal between you, stay calm, and avoid any defensiveness or anger: try to seek common ground through further verbal communication.
Communicate effectively: ask questions and make comments with confidence and directness; listen well, don't interrupt; and be aware of any messages your body language might be sending (i.e. slouching might communicate lack of engagement).