Cutting a straight line on a crooked board can be difficult and dangerous if you attempt to do it freehand . Using a jig is not only safer, it does a better job. Here’s how to build it.
Find a scrap of plywood with a factory edge and rip it about 5 inches wide. Fasten a backing block to the end , then screw a push board into it , forming the business end of the jig.
Screw small blocks into the straightedge at each end, spaced to approximately match the length of the crooked wood . Attach a second block on top of the first to hold down the workpiece  while you move it through the table saw .
With a straight edge established, you can remove the jig, flip the lumber over so the straightened edge runs against the fence, and rip it to the width you need.