Replace the whole thing, important questions are what's above it??
If it's a gable end and nothing above it's easy.
If it's on a support wall with nothing above we run a 2x4 on the ceiling the length of the wall about 3' from the opening, use 4x4 jackstuds under each joist 1" longer than the height plumb and brace.
I like LVL's for the header x2 so no plywood between 2 11 1/2 x 1 1/2 LVL, glued and nailed at 18' long is strait and strong.
or 2 2 x 12 yellow pine 18' with 1/2" ply in the middle run on edge glued and nailed crown up.
frame a king stud and two jack studs cut strong on each end to set it on. your rough framing should be 1 1/2" taller and 3" wider than the door.
Go tall as you can, If you have 9' walls you can end up with a full 8' door height if you shove the header up to the top plate, 8' is becoming standard because of taller vehicles.