The Philando Castile shooting was a definite case of the cop acting improperly. "Improperly" doesn't sound strong enough but I'm unable to come up with the right word at the moment. However, if you listen to the video afterwards the cop is absolutely distraught to the point of tears. It's clear he overreacted and thought Castile was going for a weapon. He will be put on trial and face the consequences, and Castile's death is an unmitigated tragedy. That said, the situation could have been avoided if Castile had announced what he was about to do asked the cop if he was OK with it first. Not BLAMING Castile. Fault is definitely with the officer. I'm merely offering a suggestion on ways this could have been avoided.
Sterling is a different case entirely despite attempts to conflate the two simply because both victims were black. Sterling was a convicted felon. He had a gun on him, which is illegal for a convicted felon to possess. Police were responding to a call where Sterling was reported to be waving a gun and threatening people with it so they had every reason to suspect it was a very dangerous situation. Sterling refused verbal commands to stand down and be searched, no doubt because he knew if they found his weapon he'd be going back to jail. Police used Tasers on Sterling to little effect. Seeing that, they attempted to restrain him physically. He fought them, no doubt because he knew he was headed to jail if they succeeded. During the fight he was pinned to the ground, his left arm was pinned, but his right arm -- the arm nearest his gun -- was free. Sterling was verbally ordered not to use his hands. Sterling instead moved his hand towards his waistband, this even after the cop had pulled his weapon and had it point blank on Sterling. Cops had every reason to suspect they had an armed, belligerent suspect who was going for his weapon. Lethal force was called for.
The moral of Sterling's story is he acted stupidly and is dead because of it. DON'T fight with police, especially when you have a weapon on you, legally or otherwise. I'm not arguing people need to knuckle under to bullying cops, but it's important to consider the situation from the cop's perspective. If you have a weapon on you -- or they have strong suspicion you have one on you -- any threatening move you make can look like you're preparing to escalate. Do everything you can to assure the cop you're NOT a threat. If you have a weapon, state that fact clearly. Tell the officer where the gun is while your hands are in plain view. Offer to temporarily give up the weapon while you're being questioned. Make no sudden moves, especially if they involve moving your hands out of view of the officer. None of this is "being a pussy." It's acknowledging the cop DOESN'T know your intentions and, like all of us, would like to go home to his/her family at the end of the day alive instead of to the morgue.