In Apex triggers, context variables tell you what changed. Trigger.new is always the incoming row list for insert/update; Trigger.oldMap shines on update/delete when you need the previous field values or the Id key. Start by naming the trigger after the object and event — your future self reads that faster than a generic name.
Trigger.newList of sObjects in the new state
Trigger.oldList of sObjects in the old state
Trigger.newMapMap<Id, SObject> for new rows
Trigger.oldMapMap<Id, SObject> for old rows
“no” means that variable is not part of this trigger event. “empty” here means before insert: rows exist in Trigger.new but Ids are not ready for a map yet — use Trigger.new in a loop instead.
Example trigger shape for this operation
Swap the operation in the first line — the body pattern matches what the context variables give you.
trigger AccountBeforeUpdate on Account (before update) {
for (Account a : Trigger.new) {
Account old = Trigger.oldMap.get(a.Id);
if (a.Name != old.Name) {
// field changed
}
}
}