Gosh, clothes are much more a hot topic than I ever realized before I joined this board.
I am firmly in the “dress as nice as you can, then don’t worry about it” camp. Certainly don’t skip the service if you can’t dress up. I bet the majority of the men there will be wearing kahkis and button down shirts, with and without ties. Fewer will wear suits, if it is anything like my experience.
As to behavior, don’t bring anything, but send a card. They (and your presence) will be appreciated more than you know. If you get a chance, talk to the family. All you need to say is “Hi, I am Ken. I worked with X. I am sorry for your loss. He was a wonderful boss.” However, if they are surrounded, don’t sweat it. Sign the register, if they have one. Bow your head during any prayers. Avert your gaze from anyone who is crying, so as to give them some psychological space (unless you are talking to them, obviously). If it is an open casket funeral, you can go to the front to say goodbye, but you don’t have to. Some people like to do that, but not everyone does.
Sorry if this is all stuff you know. I just thought I would pretend you have never been in public.