You'll need to go to a shop and in the window where you can buy and sell stuff. In the bottom corner of that window theres 2 buttons next to a 3rd button with a ? button, clicking the 1st one can repair individual equipment, while the 2nd can repair all equipment. They cost zeni to repair though.
Fully broken lv30 legendaries are about 30~40k repair, fully broken lv38 legendaries go over 60k repair :P
I dread to see a fully broken lv50~55 set T__T