Philandro Castillo was killed because he told the cop he had a gun and reached for it and refused to freeze when the officer told him to.
I realize if you ever touched a gun you'd scream hysterically and break out in heaving sobs, but actual gun owners get lots of advice on what to do if you're pulled over and have a legal gun in the car.
1) Be White. They'll take you alive even if you just shot 9 people in a church. If you are really nice, they might even take you to Burger King.
2) If you aren't white, expect to be shot with no consequences.