public void TakeDamage(int damage) error: modifier public not valid

Whenever I try to run my code I get the following error: public void TakeDamage(int damage) error: modifier public not valid at (20,9), help! here is my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Wemble : MonoBehaviour
{
    public int health;
    public float speed;

    private Animator anim;
    void Start()
    {
        anim = GetComponent<Animator>();
        anim.SetBool("isRunning, true");
    }

    // Update is called once per frame
    void Update() {
   
        public void TakeDamage(int damage){
            health -= damage;
            Debug.Log("damage TAKEN !");
        }
    }
}

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

 public class Wemble : MonoBehaviour
 {
     public int health;
     public float speed;
 
     private Animator anim;
     void Start()
     {
         anim = GetComponent<Animator>();
         anim.SetBool("isRunning, true");
     }
 
     // Update is called once per frame
     void Update() 
     {
    
     }

     public void TakeDamage(int damage)
     {
        health -= damage;
        Debug.Log("damage TAKEN !");
     }
 }

You don’t declare a method inside another method. You were trying to declare TakeDamage inside of the Update method.