SQL Server access table at a time
A lock will be taken by whichever process accesses the row (or table) first, and the second process will have to wait until the lock is released. This happens automatically.

Occasionally, there will be a deadlock where two processes attempt to update the same record, and one of these will be killed by SQL Server. The resolution there is to retry the process again.

In your example, if two users try to update a row at the same time, the first user there will change it, and then the second user will change it again once the lock is released. That's literally how it was designed to work.

If you want to prevent the second user from changing the record because the first user already changed it, that's application logic, well outside of the scope of SQL Server.