Not difficult, but it can be confusing. You can buy new cord many places. If the old cord is still in place, you can use it as a guide.
It is a LOT easier to do this with the traverse rod down on the floor, even though that means taking down the drapes. Just leave some slack so when you put the rod back up, you can adjust the length of the cord.