As root you need to edit /etc/apt/sources.lst
Then add contrib and non-free at the end of each line that begins with deb and deb-src just like the example:
deb http://http.us.debian.org/debian jessie main contrib non-free
deb http://security.debian.org jessie/updates main contrib non-free
Save the file, and run ‘apt-get update‘ and optionally ‘apt-get upgrade‘ to activate the changes.
If you have
software-properties-commoninstalled you can useapt-add-repository contribandapt-add-repository non-freeto do it conditionally and be a little more robust to potentially differently modified sources lists.