Answer is: buffers.
Buffer solution is a solution consisting of a mixture of a weak acid and its conjugate base, or weak base and its conjugate acid. Its pH changes very little when a small amount of strong acid or base is added to it. Buffer solutions keep pH at a nearly constant value.
Some buffers are: ethanoic acid and sodium ethanoate, ammonia solution and ammonium chloride.