The songwriter who helped make Ariana Grande’s “thank u next” one of the year’s defining albums takes us through a night that ran the emotional gamut.