To open code behind custom library

Can someone help me with how to a see code behind custom library or package.
Also how to create a library