First the source is connected and the current builds up toward the steady value. Then the source is disconnected and the remaining RL loop decays exponentially. The magnetic field energy stored in the coil is gradually converted into Joule heat.