does anybody know how to programme the key to the car? my focus seem's to have forgotten the code

. there's a new battery in the key but it's stopped operating the central locking. and it also reset's the trip meter when starting the car up.. anybody have any idea's what could be up?