If you logon to domain workstation, but get the "The Trust relationship between this workstation and the primary domain failed" error, then it usually means that computer domain account has different password than computer thinks, and you have to reset the computer account password.
To do this, you need to logon to computer with local account, run Powershell as admin and then execute this command:
Reset-ComputerMachinePassword -Server [DC-FQDN] -Credential [DOMAIN]\[USER]
Where DC-FQDN is name of reachable domain controller and DOMAIN\USER is user account which has permissions to reset computer account password.
Then reboot and you will be able to log on to domain.