There are always two spirits at work: the Holy Ghost and a satanic or false spirit. Witchcraft comes from a satanic spirit and opposes God's Spirit.
God knows everything, but this does not eliminate man’s responsibility to confess his sins. Failure to do so forfeits God’s practical forgiveness.
Most people view sin as a private or earthy matter. Yet, every sin is against the Lord. In truth, men can sin against the Father, the Son, and the Spirit.