How to use Tools.Contains() method in visual studio 2022

I have completed the password checker program task but how would we create Tools.Contains() method in visual studio 2022. it show the error The name ‘Tools’ does not exsit in the current context.

Link: https://www.codecademy.com/courses/learn-c-sharp/projects/csharp-password-checker