There's a bitter spray you can buy from pet stores that you just spray on the cords. Tastes absolutely vile, but completely safe. They'll chew it once, taste it, then stop
Vinegar or lemon/lime juice might work in a pinch, but it's not as effective. I used vinegar when I got a kitten and he didn't give a stuff about it. Stayed away from the bitter spray, though
Yelling "NO!" And not having cords everywhere are good things to do in addition