Ok. First question - do you know how to use a multimeter? You will need one.
To answer your first question - that is the credit knocker - that’s what makes the pop sound when you win a game.
You are going to have to replace the power cord. It goes to the transformer - the heavy square thing near the front of the machine. If you follow the cord you have in your hand, you will find the transformer. The cord will need to be fed out to the back of the machine, which usually means removing the head (which is where the scores are displayed). There are usually four bolts that hold it down, and wires going to rectangular pieces that unplug. Under no circumstance should you have to cut any wires to remove the head.
You will have to remove the Backglass to remove the head. Search UTube on how.
Visit Pinwiki to learn about EM (Electromachanical) machines.
Welcome to an addicting hobby - there’s nothing like the feeling you get when bringing something back to life. This should be an easy repair for many, but since it’s your first, it may seem daunting, but you can do it.
Ask questions so you can do this safely and correctly. Search this forum for replacing power cords. There are several threads about how to.
Good luck