To compare the code of a modified class there are 3 options :
- In Team Explorer, select Compare with Latest Version.
- In Team Explorer, select Compare with Workspace Version
- Run the diff command
Example:
In Team Explorer, right-click FMRental.xml, and select Compare with Latest Version.

Choose Compare with Latest Version to see how the changes you have made compare to the latest version of the file on your Team Foundation Server.
Choose Compare with Workspace Version to see what changes you have made to the version you checked out.
The diff tool of Visual Studio is very good to compare two files.
It compares, and if it is possible, displays differences between two files, files in two folders, or a shelveset and a local or a server file.
Syntax:
tf diff[erence] itemspec [/version:versionspec] [/type:filetype]
[/format:format [/ignorespace] [/ignoreeol] [/ignorecase] [/recursive]
[/options][/noprompt][/login:username,[password]]
Reference:
https://docs.microsoft.com/en-us/azure/devops/repos/tfvc/difference-command