Learning to Make libraries but code hangs

pump.cpp declares some global variables with the same names as the class's private variables. You already #included the .h file, so the declarations inside the class are done.

I had to copy the code to run the autoformat on it. I hope that it's properly formatted on your end. It's unreadable to me without proper indenting.

You call pinMode() in one of the class constructors. While that probably will work, it's a bad idea in the Arduino to do any meaningful work at all in a constructor. The constructor is called before the Arduino helper functions are set up so you really should do all of that in a .begin() method.

Try NOT to write blocking methods. runThePump() seems to have a long loop with a lot of delay()s in it. Why should you allow your Arduino to get stuck in this loop when there's other useful things it could be doing, like running the other pump at the same time?