Saving A Player's Data

So far I have this code for changing a player’s team.

local players = game:GetService(“Players”)
local noTeam =game:GetService(“Teams”)[“No Team”]
local team = game:GetService(“Teams”)[“Labyrinth Hunters”]

local player = players:GetPlayerFromCharacter(hit.Parent)
if (player and player.TeamColor == noTeam.TeamColor)then
player.Team = team
player.TeamColor = team.TeamColor

How do I save the player’s data so when they join again they will stay on the same team?
Also how do I make my code so it’s easier to read on devforum?
Thanks for your time.

Put ``` at the start and end of your code.

You know the basic of Datastore right?