how do i flatten my hardwood?
Worst case scenario: remove the flooring.

Medium damage throughout: Lay down 3/8" plywood over it, first replacing heavily damaged areas.

Every board is slightly cupped: Have it professionally sanded and refinished. Upright floor sanders can be rented but they are not for novices. A random orbit sander would get it done... eventually.