SQL Server access table at a time Multiple users access to write on the same table on same time on same record. How to avoid this problem in SQL Server?

Already we implemented record locking. But the record locking will be be enable at updated time. For example, I have one record, user 1 opens the record and edits something, user 2 also opens the same record and edits. Both are submitted at the same time. If they submitted serially, there would be no problem. If they submitted at the same time (it is occurring rarely). How to solve this problem?
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.