Outpatient: there's really not much you can do to be helpful as a med student. Make sure the attending you'll be following knows you're coming, and ask ahead of time what expectations will be re: shadowing vs seeing patients yourself then presenting, writing notes, etc.
Inpatient: like any inpatient medical rotation. Concise presentations (nothing will elicit more eye rolls than a med student rambling, not even putting zebras at the top of your differential), know your patients better than your residents or attendings, pay attention on rounds and when tasks are discussed be the first to volunteer to do the ones you are allowed to do. An occasional pointed, relevant, patient-centered question is appropriate for rounds, but most of that should be saved for after rounds so that everyone isn't held hostage by the attending explaining really basic stuff to the med student ad nauseum.