We can't avoid dead lock fully , but the number of dead lock can be minimized.You can find how to minimize deadlock in the Books online under section Dead lock Avoiding.
U can use trace flag 1024 for more information about locking.Also use sql profiler to monitor the cause and identify dead lock .check the following link
SQL Server 2000: Some useful trace flags