Materials on the Internet are treated the same under copyright law as any other copyright-protected materials, so if you want to use them, they have to fall within one of the Copyright Act's exceptions (such as fair dealing or the educational use of the Internet exception), be available through an open access licence, or be in the public domain. It is also important that you legally source content you want to use; you can't use pirated, or copyright infringing content. For more information, see How can I tell if the materials I find online are legal copies?
For example, the Internet Archive, Flickr, or Wikimedia, provide free access to a variety of content. Some of that content is uploaded by trusted users, and is in the public domain or openly licensed and can be used freely. Other content is uploaded by unknown or questionable users, is copyright protected and can't be used. It is up to you to evaluate the content you use for legitimacy.
If what you want to use isn't from an open access or public domain source and does not fall into one of the Act's exceptions, you will have to obtain permission from the copyright owner. Note that the person or institution who posted the material may not be the copyright owner and may not have the right to grant you permission to use the material. If this is the case, you should not use the material unless you can identify the copyright owner and obtain the copyright owner's permission.
Even if your use is non-infringing under the Copyright Act, your use may represent a breach of a condition described in a website's "Terms of Use" or "Legal Notices" statement. You should consult those sections to confirm what conditions apply to using of the website's material and whether additional permission is required.