If you have bought a new printer , it will come with a disc for installation.
However , my preferred method is to go to the manufacturers site and download the latest software for the piece of hardware.
Then run the software on the computer and follow the instructions.
Don’t plug the hardware / printer in until the message to do so appears on the computer screen.
Then follow the instructions about the ink , networking etc
But remember don’t plug it in or connect to the computer until the message appears on the screen.
The install software first and turn on hardware second rule applies to most pieces of computer hardware from routers to scanners.
Windows 8 computers and Apple computers will however go out and get the software necessary to run the printer when you plug it in.