A free version of the United States Code is available from the Office of Law Revision Counsel.
If you are looking for current New York State laws, start here:
West's McKinney's Consolidated Laws of New York Annotated
Arranged by subject and updated with pocket parts in the back of each volume and paper supplements. Use the Index for subtopics and Popular Name Table to find laws by name. Available in Westlaw Next Campus Research.
An unannotated version of the New York Code is available on the New York State website.
For text and passage history of individual New York City laws (known as local laws), see the website of the New York City Council.