Every so often we read a tragic story about a plainclothes officer getting shot by uniformed officers who mistook him/her for a gun-wielding suspect. Follow the practices below to avoid getting yourself shot if you find yourself drawing your gun in plain clothes either on or off duty.
Don't rush in. Don't reflexively draw your gun and intervene in a situation if there isn't a danger to the public. The risk is high, and you probably have no backup. Consider being a good witness instead.
Put your gun away when you see uniformed officers on scene. They are armed let them deal with the suspects. Don't look like one yourself.
Always carry your badge when you carry a gun. Do not carry your badge in your cash wallet. If you're robbed, your badge is a clue to the bad guy to shoot you right away. Carry your badge in a separate wallet, or around your neck. If your gun is out when the uniformed officers arrive, wave your badge and loudly identify yourself. Don't just hold your badge next to your gun or away from it—responding officers will reflexively lock their vision onto your gun.
Drop your gun if ordered to do so by other officers. This should be obvious, but when you're not used to being treated as a suspect, in the heat of the moment you may well not drop your gun. Practice this scenario with other officers on break time, and visualize it repeatedly.