I need a 24 hour timer that is always counting down. When the time reaches 0.00.00 it just restarts back to 24.00.00 and counts back down again. But I need it to run a code only as soon as it hits 0.00.00. I also need to make this as secure as I can, so no one can cheat this by changing time on device for example. Any help would be greatly appreciated, thank you in advance.

If user changes the time in his device then its not secure @cjdev

You could use the TImeSpan class in an implementation something like this:

    DateTime startTime;
    TimeSpan currentTime;
    TimeSpan oneDay = new TimeSpan(24, 0, 0);

    void Start()
    {
        StartTime();
    }

    void Update()
    {
        currentTime = DateTime.UtcNow - startTime;
        if (currentTime >= oneDay)
        {
            DoStuff();
            StartTime();
        }
    }

    private void StartTime()
    {
        startTime = DateTime.UtcNow;
    }

    //Returns a string with currentTime in a 24:00:00 format
    private string GetTime(TimeSpan time)
    {
        TimeSpan countdown = oneDay - time;
        return countdown.Hours.ToString() + ":" + countdown.Minutes.ToString() 
                            + ":" + countdown.Seconds.ToString();
    }

Timer is simple thing. Calculate expiry timestamp, store that into PlayerPrefs (in order to restore it if user reboots the game). Like so:

DateTime expiryTime;

void Start () {
	if ( !this.ReadTimestamp ("timer") ) {
		this.ScheduleTimer ();
	}
}

void Update () {
	if ( DateTime.Now > expiryTime ) {
		OnTimer ();
		this.ScheduleTimer ();
	}
}

void ScheduleTimer () {
	expiryTime = DateTime.Now.AddDays (1.0);
	this.WriteTimestamp ("timer");
}

private bool ReadTimestamp (string key) {
	long tmp = Convert.ToInt64 (PlayerPrefs.GetString(key, "0"));
	if ( tmp == 0 ) {
		return false;
	}
	expiryTime = DateTime.FromBinary (tmp);
	return true;
}

private void WriteTimestamp (string key) {
	PlayerPrefs.SetString (key, expiryTime.ToBinary().ToString());
}

Security is harder. The most secure way is to get current time from server. Get the server time at the session start (when app is foregrounded) and calculate offset from local device time:

// store offset somewhere at session start
TimeSpan offset = serverTime - DateTime.Now;

// this is how to calculate the real time
DateTime realTime = DateTime.Now + offset;

Here you can read how to implement a server: Get real world's time which independent with device - Questions & Answers - Unity Discussions

Also, I have an asset for preventing time cheating without server and internet connection. It is a native plugin for iOS and Android and works fully offline. Unity Asset Store - The Best Assets for Game Making

Very simple API: UnbiasedTime.Instance.Now() (a replacement for DateTime.Now). Unbiased time will NOT change with device clock settings.