Hide stars after collected

Hi guys
I have some stars in my game that after player collected them I want inactive them next replay.
Below is my database code

using System.Collections;
using System;
using System.IO;
using System.Collections.Generic;

using System.Runtime.Serialization.Formatters.Binary;
using UnityEngine;

public class DataManagement : MonoBehaviour
{
    public static DataManagement datamanagement;

  
    public int index;
    public bool visible;
    public GameObject ActualGameobject;
    public Vector3 posision;

    List<gameData> items;
    private void Awake()
    {
        if (datamanagement == null)
        {
            DontDestroyOnLoad(gameObject);
            datamanagement = this;
        }
        else if (datamanagement != this)
        {
            Destroy(gameObject);
        }
    }

  
    public void SaveData()
    {
        BinaryFormatter binaryForm = new BinaryFormatter();
        FileStream file = File.Create(Application.persistentDataPath + "/gameInfo8.mtr");
        gameData data = new gameData();

        data.index = index;
        data.visible = visible;
        data.ActualGameobject = ActualGameobject;
        data.posision = posision;

        binaryForm.Serialize(file, data);
        file.Close();
    }


    public void LoadData()
    {
        if (File.Exists(Application.persistentDataPath + "/gameInfo8.mtr"))
        {
            BinaryFormatter binaryForm = new BinaryFormatter();
            FileStream file = File.Open(Application.persistentDataPath + "/gameInfo8.mtr", FileMode.Open);
            gameData data = (gameData)binaryForm.Deserialize(file);
            file.Close();

           

        }

        else { Debug.Log("No dataBase"); }
    }




    [Serializable]

    class gameData
    {

        public int index;
        public bool visible;
        public GameObject ActualGameobject;
        public Vector3 posision;

    }








}

Please help me what should I do

This does not seem like a database related question to me. Didnt have a long look at your code, but you probably save your star locations in that database and then load them, right? You then instantiate star gameobjects at these locations? If so, just destroy or disable those objects when they are being collected. Next time you load the scene they will be there again anyways, unless you delete them from your database or somehow permanently delete them from your scene. Not entirely sure what your problem is otherwise.

Also, posting 2 times in 2 minutes is a bit unnecessary. You could have just used the edit function.