How do I stop the trigger effects once the player leaves the collider?

How do I make it so that once the player leaves the collider, she no longer has any of the triggered gravity effects?

Hello! I have a scene where the player can go in and out of the water. I am quite new to coding but I have managed to make it so that when the player enters the collider underwater the gravity changes so that the player falls/jumps slower and underwater sound effects play. The problem is that when the player leaves the water and goes back onto land, the underwater gravity effect triggered by the collider (and underwater sound) still remains. How do I make it so that once the player leaves the collider, she no longer has any of the triggered gravity effects?

Here is my code:

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

public class TriggerSFX : MonoBehaviour
{
    // Start is called before the first frame update
  public AudioSource playSound;
  

  void OnTriggerEnter(Collider other)
  {
      playSound.Play();
    Physics.gravity = new Vector3(-3, -0.6F, -3);
      
  }

 


}

Any help would be greatly appreciated! Thanks!

Can you use OnTriggerExit () to stop the sound and return gravity values to normal?

Use OnTriggerExit function to stop stuff once player exits the trigger collider.