For among them are those who creep into households and capture weak women, burdened with sins and led astray by various passions, always learning and never able to arrive at a knowledge of the truth. Just as Jannes and Jambres opposed Moses, so these men also oppose the truth, men corrupted in mind and disqualified regarding the faith. But they will not get very far, for their folly will be plain to all,as was that of those two men.This reference has a strange encouragement for Timothy. In the battle of the gods recorded in Exodus, Pharaoh's sorcerers matched Moses and Aaron on points for a few rounds. Eventually, however, they were outclassed and forced to concede that the finger of God was at work (Exod. 8:19).
It seems that this reference is part of Paul's pastoral counsel to Timothy. In the long run, as with Pharaoh's court magicians, the false teachers will be exposed as bogus. So don't be intimidated by them, neither by their claims or their results. It is a show, a pretense, the appearance of godliness but not the power (2 Tim. 3:5). And no wonder. These men have cut themselves off from the ministry of the Holy Spirit. They oppose the truth (3:8; cf. 2:17-18, 4:15).
Timothy, on the other hand, must fan into flame the gift of God (1:6-7) and by the Holy Spirit "guard the good deposit," the apostolic gospel, that has been entrusted to him.
The battle for truth and error in ministry must be entered into with a long term view. The truth will endure and triumph. There is no need to panic and no need to be intimidated.