If you are talking about the thermal paste that is in between the cooler and the cpu then you did NOT void the warranty of the cpu nor the warranty of the cooler.
I already did it because my i5 4690 for reaching high temps and i changed the paste and cleaned the cooler but does that void my warranty? 2 more years left of warranty
depends on warranty. changing it on prebuilt system, yes. Typically just opening prebuilt systems yourself voids warranty. out of box cpu, warranty won't cover damage you cause yourself in changing the paste.
Whose cpu is it and what product line. Read the warranty and see if it mentions it.
If you are talking about the thermal paste that is in between the cooler and the cpu then you did NOT void the warranty of the cpu nor the warranty of the cooler.