Praise be to Allah.
Your feeling that you have sinned, and the pain that you feel in your heart because of that, indicate that your faith is sound and that your heart is pure. This is a blessing that Allah has bestowed upon you, for those whose hearts are truly alive are those who are affected by sin and who flee to Allah in repentance and seeking forgiveness. As for those whose hearts are deadened, they are not affected by commission of sins, as it is said: The dead feel no pain.
Allah says concerning the people of faith (interpretation of the meaning):
“Verily, those who are Al-Muttaqoon (the pious), when an evil thought comes to them from Shaytan (Satan), they remember (Allah), and (indeed) they then see (aright).”
What is meant is that they commit sins, then they remember the punishment of Allah and His great reward, and His promises and warnings, so they repent and turn to Him, and they seek refuge with Allah, and come straight back to Him. “... and (indeed) they then see (aright) ,” i.e., they realize the error of their ways and set themselves straight. End quote from Tafseer Ibn Katheer.
All you have to do is repent and seek forgiveness, and remember that you are turning to a Lord Who is Most Merciful, Who rejoices over the repentance of His slave and accepts it from him, and turns his bad deeds into good deeds, no matter what these bad deeds were.
It is as if you do not realize that Allah accepts the repentance of kafirs (non-Muslims), atheists, evildoers and sinners if they repent and turn back to Him, so how can He not accept the repentance of believers if they fall into sin, when they are the ones who love Him and turn to Him, who bow and prostrate, who do wudhu and purify themselves, and know that no one can forgive their sins except Him, and no one can help them to mend their ways except Him; so they hasten to regret (their sin) and seek His forgiveness, and say: Our Lord, we have wronged ourselves, and if You do not forgive us and have mercy on us, we will be among the losers. The Most Merciful says to His angels: My slave knew that no one forgives sins except Me. I bear witness to you that I have forgiven him. Then his sorrow and worry disperse, and contact with Allah is re-established and he feels comforted. By Allah, how sweet is the joy of the penitents and how beautiful is the return of the sinners.
The Most Merciful Lord says (interpretation of the meaning):
“Know they not that Allah accepts repentance from His slaves and takes the sadaqat (alms, charity), and that Allah Alone is the One Who forgives and accepts repentance, Most Merciful?”
“And those who invoke not any other ilah (god) along with Allah, nor kill such persons as Allah has forbidden, except for just cause, nor commit illegal sexual intercourse - and whoever does this shall receive the punishment.
The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allah will change their sins into good deeds, and Allah is Oft‑Forgiving, Most Merciful.”
[al-Furqan 25: 68-70]
Al-Bukhari (7507) and Muslim (2758) narrated that Abu Hurayrah (may Allah be pleased with him) said: I heard the Prophet (peace and blessings of Allah be upon him) say: “A man committed a sin and said: ‘O Lord, forgive me.’ His Lord said: ‘Does My slave realize that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave.’ Then as much time passed as Allah willed, and he sinned again and said: ‘My Lord, I have sinned again, please forgive it.’ [Allah] said: ‘Does My slave realize that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave.’ Then as much time passed as Allah willed, and he sinned again and said: ‘My Lord, I have sinned again, please forgive it.’ [Allah] said: ‘Does My slave realize that he has a Lord Who forgives sin, and calls people to account for sin? I have forgiven My slave.’”
And Muslim (2749) narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) said: “By the One in Whose hand is my soul, if you did not commit sin, Allah would dispense with you and create people who would commit sins then ask Allah for forgiveness, then he would forgive them.”
So hasten to repent, regret your sin and seek forgiveness, and do a lot of righteous deeds, and receive glad tidings of goodness and success.
One of the tricks of the shaytan (devil) is to make sin appear attractive to a person, so as to make him fall into it, then make him despair of repenting; he gives him false advice: How can you return to Allah when you have done what you did? Do you not feel ashamed before Him? Do you think He will accept it from you? A person’s sin may be major, such as zina (adultery or fornication), then he leads him through that into something that constitutes kufr (disbelief), such as not praying. So think about how the shaytan toys with this man.
As for the believer, the shaytan has no way to reach him in this manner, because he knows what we have stated above, about repentance being essential and about his Lord rejoicing over it, and how He honours those who repent and turns their bad deeds into good deeds.
It is not permissible to go to practitioners of witchcraft, soothsayers or fortune-tellers, even if this is in order to undo a spell, which is called nushrah. Rather spells are to be treated with Quranic verses and Prophetic du’as (supplications), and by turning to the Creator of mankind, may He be glorified and exalted. See the answer to questions no. 11290 and 48967.
The Prophet (peace and blessings of Allah be upon him) said: “Whoever goes to a fortune-teller and asks him about something, his prayer will not be accepted for forty days.” Narrated by Muslim (2230).
And he said: “Whoever has intercourse with a menstruating woman or with a woman in her back passage, or goes to a fortune-teller and believes what he says, has disbelieved in that which Allah revealed to Muhammad (peace and blessings of Allah be upon him).”
Narrated by Ahmad (9779), Abu Dawood (3904), al-Tirmidhi (135) and Ibn Majah (936); classed as saheeh (authentic) by al-Albani in Saheeh Ibn Majah.
This is to be understood as referring to minor kufr, according to many scholars, unless he believes that the practitioner of witchcraft or fortune-teller has knowledge of the unseen.
Al-Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: “…and asks him about something, his prayer will not be accepted for forty days” – the apparent meaning of the hadeeth is that just asking him something means that his prayer will not be accepted for forty days, but this is not absolute. Asking a fortune-teller and the like falls into several categories:
1 – Asking him a question. This is haram because the Prophet (peace and blessings of Allah be upon him) said: “Whoever goes to a fortune-teller …” The fact that punishment is confirmed when asking him indicates that it is haram (impermissible), because there is no punishment except for doing a haram action.
2 – Asking him and believing him, and paying attention to what he says. This is kufr because believing that he has knowledge of the unseen is disbelieving the Quran, as Allah says (interpretation of the meaning):
“Say: None in the heavens and the earth knows the Ghayb (Unseen) except Allah.”
3 – Asking him in order to test him and find out whether he is telling the truth or lying, not in order to follow what he says. There is nothing wrong with this and it is not included in the hadeeth. The Prophet (peace and blessings of Allah be upon him) asked Ibn Sayyaad: “What am I hiding from you?” He said: Al-dukh (referring to Surah al-Dukhan).
He said: “Be off with you! You will never go beyond your rank.” The Prophet (peace and blessings of Allah be upon him) was asking about something that he was concealing from him in order to test him, and he told him of it.
4 – Asking him in order to show up his inability and lies, so he tests him with things. This may be obligatory or essential.
Undoubtedly, disproving the sorcerer’s statements is something essential, and it may be obligatory. So asking questions of the fortune-teller is not haram in all cases, rather it depends on what is indicated by the shar’i (legal) evidence. End quote from al-Qawl al-Mufeed (2/49).
Based on this, if you did not believe that this practitioner of witchcraft had knowledge of the unseen, then you are safe from major kufr, praise be to Allah.
Some scholars are of the view that it is permissible to undo witchcraft with witchcraft, but this is a weak view, that opens the door to evil and encourages practitioners of witchcraft to carry on with their falsehood and encourages others to learn witchcraft on the grounds that they will benefit people.
Wearing an amulet in the belief that it can bring benefit or cause harm is major shirk (polytheism). Believing that it has some effect is minor shirk. See question no. 34817.
We ask Allah to accept your repentance and to erase your sins, and to give you well being in your religious and worldly affairs.
And Allah knows best.