Bathroom light fixture above sink and ceiling fan/light combo wiring issue
It sounds like you have your supply and a switch leg. The switch leg goes to the switch , normally you connect your hot to the white of the switch leg and Mark that white with black or some other color than green,gray or white. After that the white and black go to the switch. With the switch in the on position the black will now be hot , to connect your light use the black on the switch leg and the white from the hot cable. And of course grounds if available. When you had the white to white and black to black the pop you heard was a bad thing it may have damaged your switch, so if the switch is not working a replacement may be needed.