In relativistic heavy ion collisions at RHIC and the LHC, a quark gluon plasma (QGP) is created for a short duration of about 10fm/c. Quarkonia (bound states of $c\bar{c}$ and $b\bar{b}$) are sensitive probes of this phase on length scales comparable to the size of the bound states which are less than 1fm. Observations of quarkonia in these collisions provide us with a lot of information about how the presence of a QGP affects various quarkonium states. This has motivated the development of the theory of heavy quarks and their bound states in a thermal medium, and its application to the phenomenology of quarkonia in heavy ion collisions. We review some of these developments here.