I can’t tell you how many times we’ve walked up the hill to our barn only realizing we forgot the key when we reached the tack room door. Sometimes one of us would have the key but was on another part of the property and had to be tracked down before the tack room could be accessed. We also needed a way to provide guest access when we travel. The solution for us was a keypad deadbolt. We purchased this Kwikset version for around $60, about the price a similar one goes for today (like this one at Amazon). The deadbolt is water-resistant and the batteries last a long time – almost two years when you use lithium AA batteries. If the batteries die, you can simply use the key. Each of us has our own code and we have guest codes for those to whom we want to provide temporary access. We’ve been using this system for about 5 years now without issues.
There are, of course, all kinds of fancy new ones with Bluetooth or wifi connectivity that let you lock/unlock your door from a distance but be prepared to spend two or three times more on those. If the one we have stops working, I intend to purchase another one like it. It’s inexpensive, simple, and so-far durable.