Are you building from scratch, or would you rather write an extension for existing code editors, such as Visual Studio or Visual Studio Code?
The latter is far easier than creating your own. Start here on your Visual Studio Extension journey.
For creating your own code window from scratch, first you should figure out what you'd like to have in there (features, requirements, etc). E.g., syntax highlight, error/warning highlight, customizable fonts/background/foreground, intellisense support, AI tool support, code analysis support, formatting support, etc.
Would you do a simpler character-based editor, or a graphics UI editor?
After you've cleared your requiremnt you can start creating the base minimum to load/save and display a code file while adding your features one by one.
I'd still recommend going the extension way as it requires way less work.
Good luck!