I do not believe in the devil or an afterlife, to include an idea of heaven or hell. The devil is a metaphor for the rebellious thoughts we have which goes against the social nirms. It may slso be a metaphor for negative external influences. Every religion appears to have a trickster deity. To understand the Buddhist, Confucian or Taoist/ Daoist “tricksters” it must simply understood in their context. Buddhist trickster is our minds, our very own conscious egos. Confucian tricksters are those thoughts or actions that lead a person away from family, education and benevolence. Daoist tricksters would be those things that go against the natural flow or cause change in the universe.
This is my understanding of the devil, now for hell. In ancient times the idea of hell would have served as a way to scare people into acting properly; hell was a method of control. The death penalty being widespread in some cultures helped but it was also a simple matter of high mortality rates. Only , give or take, 10% of the population would live past the age of forty. So many died as babies ( whether infantcide, or disease), young adults (war, disease, dental issues, pregnancy complications, or over work). Magic, superstition and supernatural would be easiily believed by an uneducated people. Hell was very big in China except there was a variety. Hell was always a matter if someone acting improperly. Or buddhist embraced a dily hell but acknowledged life as suffering.
Hell in christianity was influenced by the combined trickster deity ideas, Zorastrian duality and Nemesis/Hades as lords of the underworld. Also in a way to bsound mysterious or esoteric the idea of the devil thrived especially as an obstacle to overcome on the way to heaven.
In short the devil and hell are concepts i do not agree with. We and nature are our worst enemies. Yet our best allies. Medicine, education and decent forms of morals and propriety will serve us better than hell or the devil. It is complicated with other thing but more will follow at some point.