You say it’s your own mod that crashes nms on load - is it the only mod installed in that moment?
And you also use downloaded mods, and it crashes on the graphics settings screen — is that with or without your mod installed?
I’m no expert with nms mods, but the general approach is to find the culprit(s) and exclude them.
What changed before it started crashing? Nms update, mod changes, hardware changes, for example? If there was a mms update, one or more mods may have become incompatible. If you installed a new or updated mod, that one may be the culprit. Etc.
If I understood you correctly you said you wrote one yourself — does it work for other people?
Are your installed mods changing the world, meaning, if you uninstalled them, your save would break? Or are they stand-alone quality-of-life mods?
If they are standalone and few, remove all and try each by itself first to find the crashy one. If they all work fine by themselves, then you need to find out which combo of mods it is that clashes.
If you use dozens of mods, finding the broken combos will take a lot of time. you may need to remove them all and add them back in pairs, and test repeatedly. Start with the one most complex mod that is most important to you and pair it up with one each of all the others. If a pair crashes, you know your first culprit. If all pairs work, them the complex mod is likely innocent, and two (or more) of the others are the culprits.
If you use many tiny mods: The „binary method“ is to install one half of the mods and test, and then the other and test. (if the mods don’t come grouped by dependencies, then split them by a chosen criterion such as alphabetical order, or you have to keep a list.) The goal is to find the smallest subset that reliably crashes, and the largest subset that is compatible.
(If one half does not cause a crash, it does not mean these mods are 100% innocent, you can’t say. Some crashes only occur when two or three specific mods are used together.)
This is a very slow method and probably not worth the time…