Best way to set NVARCHAR size when passed as parameter

Hi,
In my application I’m using SQLServer database. I see for any query we pass to SQLServer DB the default NVARCHAR size is 4000. For example query in SQLServer looks like below

DECLARE @P0 AS NVARCHAR(4000)=‘Test Application’
select distinct … from TableA a JOIN TableB b on a.appID = b.appIdRef
where a.appName= @P0

as the column size is 100 this does not use the index efficiently. Is there a way we can change the NVARCHAR(4000) to NVARCHAR(100) so that the index works efficiently?

This was already discussed in this topic on our Zulip chat.