How do i spawn an object over time?

How do i get this to spawn over time?
Hi their. I am a super noobie programmer (mostly work as an artist) and i just wanted to ask how to spawn and arrangement of planets over time. Essentially the planets change as the player progresses through the level. I would really appreciate it. Since i really don’t have a clue on how to get started.

using UnityEngine;
using System.Collections;


public class PlanetSpawner : MonoBehaviour
{
    public Transform [] spawnLocation;
    public GameObject[] planetPrefab;
    public GameObject[] whatToSpawn;


        void Start()
        {
            spawnBluePlanet();
        }
    
        void spawnBluePlanet()
        {
            whatToSpawn[0] = Instantiate(planetPrefab[0], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
        }
    
        void spawnGreenPlanet()
        {
            whatToSpawn[1] = Instantiate(planetPrefab[1], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
        }
    
        void spawnOrangePlanet()
        {
            whatToSpawn[2] = Instantiate(planetPrefab[2], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
        }
    }

public class Spawner : MonoBehaviour
{
public Transform spawnLocation;
public GameObject planetPrefab;
public float time;
private int planet_size;
private int location_size;

 void Start()
 {
     planet_size = planetPrefab.Length;
     location_size = spawnLocation.Length;
     StartCoroutine(spawnPlanets());
 }
 private IEnumerator spawnPlanets()
 {
     while (true)
     {
           GameObject spawned;
           int planet_index = Random.Range(0, planet_size);
           int location_index = Random.Range(0, location_size);
 
            spawned = Instantiate(planetPrefab[planet_index],  spawnLocation[location_index].position, Quaternion.identity) as GameObject;
              yield return new WaitForSeconds(time);
      }
 }
}