Build bridges before you need something. If you only talk to people when you need something from them, nobody will be particularly happy to hear from you. Build relationships with people before you need something from them, and those relationships will be there for you when you need them.