He signed the contract and via owl, he sent the signed contract. Hagrid prepared himself, because two weeks before the school year was going to start, he had to be present in Hogwarts, in order to prepare himself for the classes. Hagrid would live in his hut since it was his home since he was expelled.