Two-way solenoid valve for controlling the flow of fluids in industrial and commercial applications