Danach means that something happens after the event just mentioned. In „Der Kurs endet um fünf. Danach trinke ich einen Kaffee“, coffee comes after class.