1) avoid putting anything into the global scope you don't have to. This is where objects often shine.
2) use verbose names that are less likely to create conflicts.
3) adhere to a naming convention such as, well, Ahmed Ghanem gave a good example of using underscores to delimit library_<function/property>
I often use camelCase in local scope and on methods/properties/library/module names and underscores between them.
templateForm_formFromArray for example, lets me know that the procedure is in /template/forms.template.php and formFromArray tells me what it does. The odds of some other function/method conflicting with that name is pretty low.
... and a lot of languages have language specific features to help reduce the odds, self instancing functions in JavaScript, namespaces in PHP, etc, etc...