There are many ways to solve this problem:
1. Try to turn off the printer for some couple of minutes before you turn it again and reconnect to your computer. If the printer still cannot recognize the ink cartridge, try the next one.
2. Sometimes, not all the ink cartridges are unrecognized. You can see on the error window which cartridge is not recognized (ex. Blue) . At this time, you have to re-install that cartridge in your printer. To re-install, first you have to move the ink-cartridge tank by pressing (usually a long press lasting up to 6 seconds) the stop button on your printer (different printers may have different symbols for this, usually, it is in the same button as the one for paper jam). You can also use the printer’s software or in the printer properties->maintenance tab and there are some buttons there for cartridge replacement. These will make the ink-cartridge tank in replacement position.
Pinch the unrecognized cartridge, you can clean it using a cloth with alcohol but make sure not to damage it. After some cleaning, carefully put it again on the cartridge tank and press the stop button again. Make sure that it is correctly installed.
Check if it is now recognized, if you have enough patience, you can repeat steps 1 and 2 up to 3 times, if it still doesn’t work, there might be some problem with you ink cartridge. You have to purchase a new one.
Note: There are still other troubleshooting methods that requires you to do something on the printer itself (not on the cartridge). This is not advisable due to the complexities of the printer parts and it is to risky.