I want to have a ScreenGUI that gets the distance from a Part in Workspace and updates the distance if the player walks away from it or closer to it
Just like the comment says, you would use magnitude!
local p1 = game.Workspace.Part1.Position local p2 = game.Workspace.Part1.Position local distanceBetweenThem = (p1-p2).magnitude
As for having a gui update when the player moves, I would recommend using the .Changed property which can be found in all Instances.
local part = playerCharacter:WaitForChild("HumanoidRootPart") part.Changed:connect(function() --then simply apply the distance code I gave you to this end)