‘Satan’ is a Hebrew word that means ‘adversary’ and in the Old Testament it is translated as adversary on 10 occasions, although on 16 other occasions it is left untranslated as Satan. There is not just one satan. Any adversary is a satan.
In the account of Balaam and his ass in Numbers 22, we are told in Num.22:22 that the angel of the Lord was an adversary (satan) to Balaam and stood in the way when he tried to do what God had told him not to do. Clearly the angel was helping to prevent Balaam from wrong-doing. In other cases there are a wide range of different types of adversaries that are included under the label of satan. In no case is the satan a supernatural being that torments the wicked in hell.
In nearly every case, the satans that are mentioned are human beings. For example, see 1 Kings 11:15,23,25. They came into existence like all human beings do, and were given the free will to decide whether they were going to be helpful or harmful.