A valve ball works by rotating to open or close a valve. When the valve is opened, the ball is turned so that the hole in the center of the ball aligns with the passage through the valve, allowing liquid or gas to flow through. When the valve is closed, the ball is turned so that the hole is perpendicular to the passage, stopping the flow of liquid or gas.