how to make my component disabled after an animation

i already done it my problem is the component is being disabled before the animation is done i have separate scripts by the way so here’s the code

here’s the first code this code is for the animation for my character

private void HandleAnswer(int answer) {
						
							if (answer == 1)
			
						{
							//handle correct answer
							ShowIncorrect = false;
							ShowCorrect = true;
							Poop = false;
		
						animation.PlayQueued ("Wrong answer",QueueMode.PlayNow);  
							Enemy.animation.PlayQueued("ENMattck", QueueMode.CompleteOthers);
							Attack();
							NextQuestion();

						}							    
							else { 
			
							ShowIncorrect = true;
							 ShowCorrect = false;
							Poop = false;

							animation.PlayQueued ("Wrong answer",QueueMode.PlayNow);  
							Enemy.animation.PlayQueued("ENMattck", QueueMode.CompleteOthers);

							AttackSelf();			
						}		

here’s the second code for my enemy which tells that if the enemy health is 0 the enemy will be disabled but what happens is after i push a certain button for the animation the enemy is disabled so i need a timer or something so that until the animation is done my component wont be disabled

	void Update () {
		
		if (curHealth <= 0) {	
			
		     PlayerPrefs.SetInt("SavedLevel1", 1);
            Debug.Log("SavedLevel = 1");		
        
				Enemy.gameObject.SetActive(false);
		 
}

A timer would be

yield return new WaitForSeconds(amountoftime);
But if you do this you would have to declare the Update function as an IENumerator and this is not allowed.
I sugest you do it like this:

if (curHealth <= 0) { 
StartCoroutine(ObjectActive());
                  }

IENumerator ObjectActive() {

PlayerPrefs.SetInt(“SavedLevel1”,1);

Debug.Log(“SavedLevel = 1”);

yield return new WaitForSeconds(2);

Enemy.gameObject.SetActive(false);

}