This is not an idiom - when you compare two things with "Like" or "As" then you have a simile. This comparison says that something is as hard as pulling teeth out would be. You often hear this said when someone is very reluctant to part with information and it must be pried out of them like pulling teeth one by one.