Hello Niharika Tiwari,
You can use conditional visibility for this situation or entity access rules.
Conditional visibility is easier to implement but less strict in the way that it prevents the use from seeing the value but it does not prevent the user to search or retrieve the value it is only a visibility thing.
With an entity access rules the user is prevented from seeing and retrieve the information if the user does not have priviledges towards the attribute.
More about visibility here:
https://docs.mendix.com/refguide/text/
More about entity access here:
https://docs.mendix.com/refguide/module-security/
Also take a look into the learning paths to see example and to learn more
Hope this helps,
Good luck!