An error occurred when processing the security tokens in the message:You are using Ws-Tust authentication which has been deprecated and no longer supported in your environment. Please use oAuth2.0 authentication in Dynamics 365 / CDS – Console App

If you are facing error while connecting Dynamics 365 from Console Application then use OAuth to connect using below code. update your code as per below.