First make sure you have purchased the correct cartridge for your printer.
Take the cartridges out of the printer and make sure all the packaging, clips and tape has been removed from the cartridge
Then while the printer is on pull the power cable out the back of the printer and leave the printer off for 15 minutes. Doing this will give your printer chance to clear the error
If the cartridge contains a micro chip, while the cartridge is out of the printer give the chip a good wipe with a tissue or cloth.
Turn the printer back on and firmly reinsert the cartridges making sure they are fully clicked into place.
If the problem persists then place all your old cartridge back into the printer and change the cartridges individually one by one. This should identify which cartridge is causing the error.