how to add update function in custom wordpress theme?


How do you add wordpress theme update function in your customer theme?
How you add code snippet in function.php?

is there any standard theme i can pick which includes all update functions ?
i want to start building a new wordpress theme, i will do the design/fancy work on it.

Let me know.