I should preface what I say with that I've only really worked with NES emulation, which is admittedly a very simple console. So my experience is somewhat limited.
Emulation is very large topic, and writing an emulator is a pretty difficult undertaking. There are a bunch of different facets to consider if you want to get into emulator coding.
To begin with, you should have an impeccable grasp on the system you're trying to emulate. Each console is comprised of many different components, such as the CPU, RAM, Video Processor, Control Input and others. You should know exactly what components your system needs to emulate, and how you would go about emulating each and every single one of them. Start by asking how you would represent something like RAM in your own emulator. How would you emulate the CPU state and the CPU opcodes?
For me, personally, I started homebrewing NES games (or trying to, anyhow) long before I even thought about writing an emulator. Having this kind of inside perspective before going in helps immensely.
To actually build a functional core, you need to connect all of your components to interface like they would on real hardware. How do you construct your own emulator architecture and timing model around the system architecture? On consoles like the NES, this is relatively simple, on more complex systems, it's not.
If you want to write an actually usable emulator, you're gonna need some kind of interface for the user to interact with. There's a bunch of different problems to solve here, like writing a GUI, loading a ROM, getting user input, getting visual and audio output or writing advanced features like save states, movie recording or debugging tools. These problems are all fairly distinct and don't have much to do with emulation directly. Instead, they are more about your ability to program a multimedia application in general.
Optimization is also a pretty large concern for more advanced emulators, but in the beginning, I wouldn't focus on it.
Personally, if you want to start, I'd recommend by starting out simple and looking at a system such as the NES or GameBoy, as these are not only very simple systems, but they are very well understood and documented also. You can find many resources on emulating them online.
Obviously, being adept at a suitable programming language like C, C++ or others is vital as well.
You can check out the source code of existing emulators also if you're stuck, but be warned, some codebases are hell.
I hope this was kinda helpful.