There are three ways to lock a record in Salesforce
2) Record Types
3) Validation Rules
This is the first option the would crawl in to peoples mind whenever there is record locking involved is Trigger. This might be an option to lock a record but writing lot of triggers might bring us close to governor limits. Hence, this would be the last option for me.
Lets assume that the record has a check box call ‘Restrict’. Create a Read Only record and create a workflow rules that changes the record type to ‘Read Only’ if the ‘Restrict’ check box is checked.
Write a validation rules saying (account.Restrict__c, true), then display an error message saying “Record is read only”
Record Types is the cleanest way I could think of to lock a record in Salesforce.