In grammatical terms, both statements are correct. Which one you might prefer depends on the context and what you want to say or to imply. Take a typical situation in which a promising athlete is not training hard enough to win a race.
Then you are more likely to remark to your friend:
He could do it if he wanted to.
The implication is that he does not want to put in the effort.
On the other hand, if you don't know whether the athlete is prepared to train hard, you might say:
He could do it if he wants to.
This leaves open the question of whether the athlete does or does not want to.
Neither of these constructions refers to the past. They both refer to hypothetical situations in the future. But the first implies that the person concerned is unwilling to do what is necessary to achieve the goal although he/she has the potential; the second leaves it open.
An alternative is to say: He can do it if he wants to. It's a more direct way of speaking. He could do it.... is a more guarded or reserved way of saying the same thing. It implies that there's a condition to be met.