Whether it's your twenty year old kitten, or a family friend, deaths are very sensitive times for people. If they mention it to you, do your best to give condolences and try to comfort them.
I went to my first Shiva - Jewish mourning service- recently and had no idea what to expect. Wikipedia research only scared me, and I then scared my whole family, into thinking that we weren't to speak to anyone or eat anything. Wikipedia must have only been to very strict Shivas because it was really a lovely gathering of people who loved the father, son, brother, husband, nephew, uncle, artist, teacher, lover, friend.
Still, I took away some very smart and considerate ways to approach grieving people:
Attending the service shows your support and sympathies, and flowers are nice too.
Don't expect to have conversations with family or those close to the deceased. They may need quiet time and will turn to you if they want.
If you do have a conversation with someone who is grieving let them choose the topic and do not suggest your own. You can't presume what they are comfortable speaking about.
A service is not a party so take cues from the hosts about the tone. Some people wish to be remembered with joy, others are taken unexpectedly and painfully.
It is not a good place to catch up with people you haven't seen in years - but it does remind us how short life is, who we love, and why don't we see each other more often!
Wearing black, white, colors, torn ribbons, crosses, brandishing handkerchiefs... is again specific to the person who passed and their family. No wrong from inquiring about what is expected from you.