Contact Field to Update from Account Field

Contact Field to Update from Account Field

So here's my scenario. I have a custom field in Accounts and Contacts and I want it so when I update the Account field, the Contact field will update as well for all the associated contacts. From what I've seen, I'd have to create a custom function for this, however, I don't know the code or algorithm to set it up. Does anyone have an  code or algorithm they've used for this before?