In a very simple sense...
Cohesion is the bonding of water molecules through hydrogen bonds. Cohesion gives continuity to water as a substance; it "keeps water together."
Adhesion is where water molecules hydrogen bond with non-water molecules. When water is inside a certain container (such as glass or the xylem); the water molecules are more attracted to the container than fellow water molecules. This is because the material is much more polar (has more difference in charge) than the water molecules. The higher polarity of the molecules that make up the container strongly attract the constantly moving water molecules. The movement of water molecules (due to kinetic energy) and the stronger polarity of the xylem causes a phenomenon called capillary action.
So in conclusion, cohesion and adhesion occur together to oppose gravity by:
-cohesion keeping water molecules together through hydrogen bonding between water molecules.
-adhesion allowing the moving water molecules to hydrogen bond with non-water molecules that make up the container walls.
The roots take up the water through capillary action, and the water continues to flow up the plant through the xylem, against gravity, through adhesion and cohesion.
Hope this helps! Here are some helpful links