Record Type Describe
Getting an object’s record type Id is simple with the statement below, and it avoids using a SOQL statment on the RecordType object. However, the method name is misleading because getRecordTypeInfosByName actually retrieves the record type with the Label and not the Name. Also, be careful because the name is case sensitive. A Null Pointer Exception will be thrown if the label does not match exact spelling and case, so add appropriate error handling.
// Return record type Id by DeveloperName
Id MyRecTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('My_Dev_Name').getRecordTypeId()
// Return record type Id by Label
Id MyRecTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('My Record Type Label').getRecordTypeId();