The official term is police officer, so officer seems to be the best term, neutral and respectful. It also seems valid regardless of their rank, gender, etc.
Excuse me officer, may I ask why my car was stopped?
Excuse me officer, I just wanted to tell you that you have a headlight out.
Answers to this question at ELU also suggest sir and ma'am (not madam, thanks @tchrist) as good alternative.
Also, UK English has another word, constable, which is a bit too official, but quite acceptable.
And don't try slang words! In some countries, it may lead you straight to jail.
P.S. In some countries, a police officer holds a highly respected position, and rank does matter. So if you are traveling and you can read insignia of ranks and you know what you are doing, you may call them by rank to show your highest respect:
Excuse me lieutenant, ...