Well, you are asking a very broad question, but understandably so if you are just learning for the first time. There are different modified versions of mame, and the version of mame you are using is very important as well. Easier types of mame to start with, like mame32 windows, are not really ideal for a cabinet, you will need to go more in depth to get your system going smoothly. I will try to just get you started with getting standard mame to work.
Here is the very basics, hopefully it points you in the right direction at least:
1 - download mame from their website. Just get the binary package. Extract it somewhere simple.
2 - You need roms (aka your games). It is very important that the roms you get match the version of mame you are using. It is against the rules for me to tell you anything about where to find them. If you can google and torrent, you should be able to find something. Once you have something, put the Roms in the rom directory in your mame folder.
3 - You will need a frontend program to run Mame from a cabinet. Regular Mame wont start by double clicking it. I recommend starting with
MALA. Extract it somewhere simple as well, and open it up. It will ask you to locate MAME, some files in the MAME directory, Roms, etc. do you best to locate it, and if all goes well, it will compile a list of the roms you have. you can scroll through the list and hit enter to play the games. hit tab while in game to change things like controls.
Obviously these are very simple instructions missing many details, but you can either fill in the gaps yourself or come back and ask more when the more specific questions come up.