How can we fill the field automatically based on Look up field value?

How can we fill the field automatically based on Look up field value?

If we want to pull data based on custom look up field value to fill another field on same module automatically, how can we do that? As for example, in Cases module if we fill contact name, it will auto fill the associated account name , I just want to do same thing for custom look up field instead of contact look up that have Account name associated.

Any help would be much appreciated.

Thank you!