When would be the best time to get an epidural?

Like how far dialated so that the medicine will still work so you wont feel the baby coming out?