It's not an easy question lol.
First of all you have to understand very well the hardware architecture of the machine / console X you want to emulate. Generally you have to get the real datasheet of each hardware components of X.
Then you will have to write in a programming langage the behavior of all those components, and for some of them (such as sound chip or video stuff) you will have to write a kind of wrapper to make them communicate to the host hardware on which your emulator is running.
For example, you will have to write code to play samples generated by your emulator to the PSP sound device ... You will have to do the same for the graphical part etc ...
Then you have to write an emulation loop that will call each hardware components emulation functions, and ensure the communication between them, and that should handle the real time / emulation time ...
Hope that helps.
Bookmarks