Phototherapy works by using light to transform bilirubin into photoisomers and lumirubin, which are more water-soluble and can be excreted via urine and feces. The light used in phototherapy is typically blue light with a wavelength of around 460-490 nm, which is most effective at breaking down bilirubin.