Call methods on start of Application

I am trying to make a bank interest system that gives you 1.25x your overall amount of coins every 10 minutes. I was unable to make it that it did it outside of the game being open so I decided to make it just while you are playing the game. So when you start the game it starts a coroutine that makes it that 600 seconds it would give you interest. I am unable to make it that this coroutine is called from the start of tha game though, someone please try to help me, here is the script :

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

public class Interest : MonoBehaviour
{
public static float fCoins;
public static int Coins;
public static bool displayTime = false;
public static float seconds;
public static string secondsTXT;

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnBeforeSceneLoadRuntimeMethod()
{
    StartCoroutine(InterestWait()); // I can not call other methods from within this method.
}

public void Start()
{
    PlayerPrefs.SetFloat("fCoins", PlayerPrefs.GetInt("Coins"));
    fCoins = PlayerPrefs.GetFloat("fCoins");
    Coins = PlayerPrefs.GetInt("Coins");
}

public void Update()
{
    if (displayTime)
    {
        Debug.Log(secondsTXT);
    }

    seconds += Time.deltaTime;

    secondsTXT = seconds.ToString("0 minutes and 00 seconds");
}

public void GiveInterest()
{
    PlayerPrefs.SetFloat("fCoins", PlayerPrefs.GetFloat("fCoins") * 1.25f);
    PlayerPrefs.SetInt("Coins", Mathf.RoundToInt(PlayerPrefs.GetFloat("fCoins")));
}

public IEnumerator InterestWait()
{
    yield return new WaitForSeconds(10f);
    GiveInterest();
    Debug.Log("Gave Interest");
}

}

I would just start the coroutine in the start function. Remove the before scene runtime.

    public void Start()
    {
        PlayerPrefs.SetFloat("fCoins", PlayerPrefs.GetInt("Coins"));
        fCoins = PlayerPrefs.GetFloat("fCoins");
        Coins = PlayerPrefs.GetInt("Coins");

        StartCoroutine(InterestWait()); 

    }

_
Then fix it to be an infinite loop. The way you have it now the coroutine will only run once then exit. With the loop it will continue running until you call StopCoroutine().

    public IEnumerator InterestWait()
    {
        while(true)
        {
            yield return new WaitForSeconds(10f);
            GiveInterest();
            Debug.Log("Gave Interest");
        }
    }

The problem is you can’t call any non-static methods from a static method and StartCorroutine/Invoke/InvokeRepeating are a non-static methods. I’d use InvokeRepeating in the Awake function and the DontDestroyOnLoad function to keep the game object loaded between scenes:

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

public class Interest : MonoBehaviour
{
    public static float fCoins; 
    public static int Coins; 
    public static bool displayTime = false; 
    public static float seconds; 
    public static string secondsTXT;

    private void Awake()
    {
        DontDestroyOnLoad(gameObject);
        InvokeRepeating("GiveInterest", 10f, 10f);
    }

    private void Start()
    {
        PlayerPrefs.SetFloat("fCoins", PlayerPrefs.GetInt("Coins"));
        fCoins = PlayerPrefs.GetFloat("fCoins");
        Coins = PlayerPrefs.GetInt("Coins");
    }
    private void Update()
    {
        if (displayTime)
        {
            Debug.Log(secondsTXT);
        }
        seconds += Time.deltaTime;
        secondsTXT = seconds.ToString("0 minutes and 00 seconds");
    }
    private void GiveInterest()
    {
        PlayerPrefs.SetFloat("fCoins", PlayerPrefs.GetFloat("fCoins") * 1.25f);
        PlayerPrefs.SetInt("Coins", Mathf.RoundToInt(PlayerPrefs.GetFloat("fCoins")));
        Debug.Log("Gave Interest");
    }
}