When you would like to execute trigger? Before update takes place or after update. Generally we need before trigger to validate the changes (like validation rule should not fail or prevent update). After trigger is to update other object fields.
To update field1 with value of Field2: Trigger updateFields on TestObject__c (before update){ for (TestObject__c obj: trigger.new){ field1__c = field2__c; } }
To update field1 with value of Field2:
Trigger updateFields on TestObject__c (before update){
for (TestObject__c obj: trigger.new){
field1__c = field2__c;
}
}
I hope it answer your question.