You just need to develop a feel for the reactivity of your compounds. Alkenes react rapidly with molecular chlorine and molecular bromine by 1,2-addition reactions. Unless you provide the halogens as radicals, you probably won't get the radical reaction.
N-bromosuccinimide is one way of providing bromine radicals, with light to activate it. This reagent does not undergo the addition reaction that molecular bromine does.
If there are no alkenes or alkynes, you can get radical additions from molecular chlorine or bromine by using light to break the halogen-halogen bond. This is a much slower reaction than the addition reaction, though, so if there are any alkenes or alkynes, they will react first.