Remus was having trouble getting a job as there was an anti-werewolf litigation so he had no money and therefore could not buy wolfsbane potion (a potion created by Damocles Belby which lets a werewolf keep his mind during a full moon), so he locked himself up in rooms every full moon so that he didn't hurt anyone. Albus Dumbledore knew of his struggles and found Remus living in a semi-derelict cottage in Yorkshire. Dumbledore offered Remus a job for the Defence Against The Dark Arts post at Hogwarts and Lupin immediately accepted. He resigned at the end of the year when Severus Snape let it slip to students that he was a werewolf.