Check the Registry Settings:
Press Win + R, type "regedit" and press Enter
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Look for a DWORD value named "PasswordExpiryWarning"
If it doesn't exist, right-click in the right pane, select New > DWORD (32-bit) Value, and name it "PasswordExpiryWarning"
Set its value to your preferred number of days for password expiry warning
Reboot.
Open Command Prompt as Admin and copy-paste the following:
net user username password /add /expires:never
Replace "username" and "password" with the desired credentials.