Public Law & Code
Public Law (or Statute or Chapter Law): This is the law as originally passed, in the legislature, whether at the federal or state level. Once a law is enacted it is placed into the "code," which is the law as it stands at the present time.
To research federal (U.S.) public laws, go to Congress.gov. This has records for both the legislation in the current congress, and public laws going back to the 93rd Congress of 1973-74.
To research at the NY state level, try the Assembly site.
Code: the law as it stands at present.
To research the federal (U.S.) and state level code, go to the Cornell Legal Information Institute site.
History of laws: to learn about the background of why a law was passed at the federal level there are several resources. One is the Congressional Quarterly Almanac which goes back into the 1960s, and is held in print copy in the reference collection, REF JK1 .C66. For both the federal and state level a newspaper database like the NY Times Historical can be helpful, as can journal articles on the law. Wests Encyclopedia can be an excellent source on law and legal topics too.