1) During the rest of the year, one says “HaKail Hakadosh” (The Holy G-d), and “Melech Oheiv Tzedakah UMishpat” (King who loves righteousness and justice), but during the ten days of repentance one says “HaMelech HaKadosh” (the Holy King) and “HaMelech HaMishpat” (The Just King), as during these days Hashem reveals His Kingship in the world. (Kitzur Shulchan Aruch 129)
2) If by error one said “HaKail HaKadosh”, and remembered immediately (Toch Kedei Dibbur i.e. within the period of time it takes to say “Shalom Alecha Rebbi U’Mori”), he must immediately say “HaMelech HaKadosh”. However, if he only remembered after Kedei Dibbur, or after he had already commenced “Attah Chonen”, he must return to the beginning of the Amidah. If by error one said “Melech Ohev Tzedakah UMishpat”, and only remembered after Kedei Dibbur, some say one should return to the beginning of the blessing, (Shulchan Aruch 582) and others say that since he mentioned the word “Melech” he does not go back. (Rema ibid, Kaf HaChaim118,1 Ben Ish Chai Nitzavim 19)