Majora's Mask will not work unless you have the Expansion Pak in the N64's memory expansion port. The memory expansion port is under the flap on the top side of the console at the very front. If your game says the Expansion Pak is not inserted, it's because instead of the Expansion Pak, you have the Jumper Pak. The Jumper Pak is the device that comes with the N64 when you first bought it, and needs to be replaced with the Expansion Pak.
The Expansion Pak is essentially a device with extra RAM to add to the N64's native RAM. Majora's Mask was programmed to use 8 MB of RAM instead of the N64's usual 4, which is why you can't play it without an Expansion Pak. Since the N64 and all of its peripherals have long been out of production, you'll have to find an Expansion Pak used somewhere, if you don't already have one. The Expansion Pak has a red top as opposed to the Jumper Pak, which is all black.