Not rocket science but as usual there are a lot of bad posts on this so:
Schema.RecordTypeInfo rt = SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('Developer_Name');
system.debug('Record Type ID: ' + rt.RecordTypeId);
or super simplified: SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('Developer_Name').RecordTypeId
Switch Opportunity for whatever object and tralala.