How do basic and acidic buffers resist pH ?

An acid buffer consists of a weak acid and its salt. If an acid is added to the solution the salt reacts with it to make more of the weak acid. If a base is added to it, the acid part neutralizes the base.

A basic buffer works on the same principle.