Obey all laws. End of story. Dumpster diving is not rocket science. There's nothing difficult about it. For most folks, the hardest part is getting up the nerve to do it.
Most divers start by scoping out likely dumpsters.
You're looking for dumpsters that are free-standing and are not compactors. Compactors are those large dumpsters that are attached to buildings with a chute and have no visible openings. Dumpster divers hate compactors. Apartment and office complex compactors aren't too bad though. You can still salvage stuff out of those.