Know the rules. There is nothing more frustrating to a referee than having a coach yell about calls when they are simply incorrect. Screaming out wrong information to referees merely makes the referee angry and you look stupid. If you are not sure about the correct ruling, discretion is probably the better part of valor. Courtesy is contagious.
Referees are generally quite responsive to genuine questions asked in a calm manner.
In addition, remember that since your behavior rubs off on those around you, you should consider having your discussions with the referee in private, away from your players. For example, there is plenty of time at half-time to ask questions of the referee apart from the people on the sideline. Victor Matheson is a USSF National Referee as well as a certified assessor and instructor. In his 15 years as a referee he has officiated over 1,600 games including A-League matches as referee and MLS matches as a 4th official and assistant referee. He has refereed in USSF amateur or youth regional competitions thirteen times and in national competitions five times.