How can i reset and add seconds in my countdown timer basically?

This is my code very simple. I’m making a game which has a timer . If player choosing True answer the countdown timer will reset and going back its original value 10f . I just want to give 10 seconds to answer the question. I tried a lot of things like Timeleft -= Time.deltaTime; and adding seconds but if i do that then my timer going fast … I dont know why. Can anyone help me to fix this issue?

void Update()
    {
        if(TimeLeft > 0)
        {
            TimeLeft  -= Time.deltaTime;
            TimeLeftText.text = TimeLeft.ToString("0");
        }
       else if( TestingQuestions.Answers.text == "True." )
            {

                TestingQuestions.TimeLeft = 10f;
            }
        else {
                    gameOver();
        }
         
    }

your code is a bit weird, try something like this

float timer;
bool run = false;

void Start()
{
    StartTimer();
}

void Update()
{
    if (!run)
        return;

    timer -= Time.deltaTime;
    timer = Mathf.Clamp(timer, 0, Mathf.Infinity); //makes sure we don't go below 0 in our timer
}

void StartTimer()
{
    run = true;
}

void StopTimer()
{
    run = false;
}

void AddTime(float seconds)
{
    timer += seconds;
}

void SetTimer(float seconds)
{
    timer = seconds;
}

just call StartTimer and StopTimer when needed, the timer will only run when the boolean ‘run’ is equal to true. When you want to add time or set the time, just call AddTime() and pass in the amount of seconds to add, do the same with SetTime(). If you want me to explain anything else about this then feel free

I changed somethings and i got this issue. I answered first question in my game and when the game showing 2nd question my countdown timer is going " 10 seconds " . it’s perfect but something wrongs . Previous countdown timer still working and if i add this line : if( Timeleft < 0 ) { gameOver(); it’s not working very well because the previous timer sill working . I just want to reset countdown and changing it 10 second again when showing new questions . Sorry for my english if you didn’t understand very well .

Note : I’m calling this script from another script…

the final code i was working is this :

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

public class Timer : MonoBehaviour
{
TestingQuestions TestingQuestions;

    float TimeLeft = 10f;
    bool run = false;

    void Start()
    {
      TestingQuestions = gameObject.GetComponent<TestingQuestions>();
        StartTimer();

    }

    void Update()
    {
        if (!run)
        {
            return;
        }
            
        TimeLeft -= Time.deltaTime;
        TestingQuestions.TimeLeftText.text = TimeLeft.ToString("F2");

        if(TimeLeft < 0)
        {
            
        }

    }

    public void StartTimer()
    {
        run = true;
    }

    public  void StopTimer()
    {
        run = false;
    }

    public void AddTime(float seconds)
    {
        TimeLeft += seconds;
    }

    public void SetTimer(float seconds)
    {
        TimeLeft = seconds;
    }
}