How do I scroll with Selenium?

How do I scroll with Selenium?

A JavaScriptExecutor is required to scroll up or down using Selenium. The x and y parameters of the scrollBy() method represent the horizontal and vertical pixel values, respectively.