Suppose I have created "Supplier" as record type in account object as shown in the image below.
Now to get id of this record type,use the code below
Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Supplier').getRecordTypeId();
system.debug('recordTypeIdrecordTypeId'+recordTypeId );
Output: recordTypeIdrecordType Id012280000009tHsAAI
Here 18 digit Id is displayed.
Id recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Supplier').getRecordTypeId();
system.debug('recordTypeIdrecordTypeId'+recordTypeId );
Output: recordTypeIdrecordType Id012280000009tHsAAI
Here 18 digit Id is displayed.