Complex sentence: The distraction freed the others and Django (just before he died of a heart attack) knowing that Wanda's soul still existed-he had crafted a doll in her image as a vessel to shelter her from Chthon's possession and he gave it to Pietro.
Split into simpler sentences: The distraction freed the others and Django (just before he died of a heart attack). He, knowing that Wanda's soul still existed, had crafted a doll in her image as a vessel to shelter her from Chthon's possession and he gave it to Pietro.