get a field from schema apex code example
Example: apex get object fields
Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.<Object API Name>.fields.getMap();
Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.<Object API Name>.fields.getMap();