Earth is actually closest to the sun in January, not August. This point in Earth's orbit is called perihelion.
It might seem counterintuitive because January is typically a cold month in the Northern Hemisphere. However, the seasons are caused by the tilt of Earth's axis, not its distance from the sun.