Printers are a headache if you don't know where to start. So here are some steps you can follow, depending on your printer:
1. First of all check if the printer has a small interactive screen, where you can navigate through a menu of some sort. If it does, look for an option that says 'setup wizard', then you have to follow the steps the printer gives you. You might have to choose setup wireless network after selecting setup wizard. Afterwards, you might get a screen with a list of wireless networks available, choose your home network (the one you use with your other devices in the house), then it will ask for your password, type it in (password is case sensitive, so be sure to type uppercase letter if needed). After that, you need to wait for a confirmation message saying you are connected to the network. The printer should work.
2. Check if you printer has a wifi button (it is a button that connects to a network automatically.) The button might have a small antenna image, or a wifi image. To use this button you will have to press the setup wireless button on you router/modem first. It should blink, if it does, then go to your printer, press the wifi button, and wait for it to link. If this works, you should get a confirmation message or the wifi button's light will go solid.
3. If your printer doesn't have either a screen or a setup wireless network button (wifi button or WPS), then you should have a usb cable attached to the printer and your computer for it to work. After you connect it, you should look for your printer's setup wizard in you computer in order to setup the wifi settings of the printer.