Question: why was the sword of gryffindor in the forest of dean?
Answer: It was during their stay in the forest that Severus Snape anonymously delivered Godric Gryffindor's Sword to Harry by placing it inside the frozen lake that resides in the forest and using his Patronus, a doe, to guide him to it.