The accompanying picture shows a very bad case of “washboarding,” the compressions left by jointers and planers, especially when they are not adjusted well, as is the case here.
Washboarding is highlighted by a stain; it isn’t disguised or hidden. So it has to be totally sanded out before staining if you don’t want it to show.
To remove washboarding efficiently, begin sanding with a coarse-enough grit sandpaper to sand through the problem efficiently, without creating larger than necessary scratches that then need to be sanded out. In this particularly bad case, you might actually begin with 60 grit, which is very coarse.
Remove the problem entirely before switching to a finer grit. Sand up through the grits until you reach 150 or 180 grit. For the finest grit you’re using, sand by hand with the grain to remove squigglies left by random-orbit sanders.