connect the black wire that goes to the light to one of the switch wires.then the other wire from the switch to the hot feed along with the outgoing wires(should be the blacks)then all the whites(neutral)together. in other words the way you had it to begin with without the switch connected.then the switch is wired so it will put a break in the hot path of the light.