If the chain hesitates or skips, you need to index your gears. The whole job is done with the barrel adjuster on the rear derailleur.
Turn the barrel adjuster
Turn it a quarter turn at a time and test the shift after each turn. Therefore, never make more than one change at once.