How to make an object appear at any given time?

I am creating a game in which i want a script for when the player collects the last object one more object appears and once they get that one that appears they will be taken to the next level so can you help me?

public GameObject NewItemPrefab;

    void PickupItem()
        {
        //code for picking up item
        SpawnNewObject();
        }
        void SpawnNewObject
        {
        Vector3 SpawnPosition = new Vector3(x, y, z);
        Quaternion SpawnRotation = Quaternion.Euler(x,y,z);
        GameObject NewItem = (GameObject)Instantiate(NewItemPrefab, SpawnPosition, SpawnRotation);
        }

if you have any trouble understanding this leave a comment asking about what you don’t understand.