The globalDescribe solution is decent and works. However, it is VERY slow and takes a lot of time at Enterprise size orgs. Can really kill performance. Instead, if you know what you want, you can use:
string recTypeID = Schema.SobjectType.Campaign.getRecordTypeInfosByName().get(‘Program’).getRecordTypeId();
and this also means you could pass the Record Type name to a method needing this. However, the object can’t be dynamic, so you might need a method per Object desired to use this.