You would use a pcall. A pcall is short for protected call and is used for calling functions that may possibly error so that it does not stop the script and we can handle it manually.
local success, errormessage = pcall(function()
game:GetService('StarterGui'):SetCore("ResetButtonCallback",false)
end)
if success then
print("Success!")
else
warn(errormessage)
end