A genuine compliment will suffuse the recipient with positive feelings, and oils the wheels of social intercourse. Only offer genuine compliments . Don't over-compliment - you will look like an insincere flatterer.
Stick to specifics; vague, over-generalised compliments are easily devalued. Never damn with faint praise, or give a compliment with one hand and take away with the other; "You look great - have you lost weight?" is a classic example of the double-edged compliment (only appropriate if the recipient has openly acknowledged a weight problem/diet etc.). Try and give the compliment in a timely manner; don't wait until you are leaving a dinner party to praise the food, for example, do so when you first taste it. A spontaneous response always feels more genuine.
If you are the recipient of a compliment, smile and say thank you. Don't denigrate yourself, or take it as a cue for boasting. Never retaliate with a knee-jerk compliment back. The recipient will, rightly, regard it with suspicion.