I have locked both door openers in the garage, like a dummy.
How do I get my garage door open???
If I buy a new opener, how do I figure out the existing code>
I have an old Sears (analog type)
This is why you must have an alternative entrance method. How would you get in during a power failure? When there is no other door, I've installed cable releases that, using a key from the outside, you can pull to disconnect the door from the opener.
Your choice now may be "how do I break in, causing the least amount of damage, which will then have to be repaired?" How is the garage door constructed? If it is multiple masonite panels in each section, you could cut your way in and then replace the piece of masonite.
If you call a garage door company they will drill a hole in the door and use a special tool to release the opener. Then they can use that hole to install the mechanical release that randy is referring to. Just don't lose the key.