Esters are carboxylic acids that their -H is replaced with an -R.
R-CO-OH ---------------- R-CO-OR
CH3-CO-OH--------------CH3-CO-OCH3
In esters look for only one carbonyle group that is connected to an O.
But anhydrides are from the addition of two carboxylic acid:
R-CO-OH + R-CO-OH --------- R-CO-O-CO-R
CH3-CO-OH+ CH3-CO-OH-------- CH3-CO-O-CO-CH3
In anhydrides look for two carbonyle groups seperated with an O, like:
CO-O-CO