A coaster, drink coaster or beermat is an item used to rest drinks on. Coasters protect the surface where the glass or mug is put. Coasters put on top of a glass can show a drink is not finished prevent contamination (usually from insects).
Restaurants and bars usually will have coasters out on their tables. They are used to protect the surface of the table. If they are made of cardboard, they will absorb liquid that may drip along the glass. Beermats usually have trademarks or alcohol advertising. Bar mats have a similar function. They are rectangular pieces of rubber or absorbent material used to protect the countertop of a bar.