Hello , I'm Suganya a Microsoft Windows Independent advisor. I'm happy to assist you.
To change the privacy settings for your team from public to private (or vice versa), go to the team name and select More options More options button > Edit team toward the bottom of the menu. Under Privacy, select either Public or Private.
Make a public team private in Teams: https://support.microsoft.com/en-us/office/make...
Manage team settings and permissions in Teams: https://support.microsoft.com/en-us/office/mana...
Hope it helps for you. Please let me know if you need further assistance.
Thank you!