Pharrell Williams, center, with his N.E.R.D. collaborators, Chad Hugo, left, and Shae Haley, in Los Angeles, Dec. 5, 2017. Though he arrived as a music superstar with the pop-gospel hymn “Happy,” Williams has for the last year been anything but. (Graham Walzer/The New York Times)