Firstly, a disclaimer: I do not find much joy in highly optimised characters that can slay everything with ease at the table. However, the idea of creating such a character (or making the most out of a suboptimal choice - e.g. using poor weapons or unconventional playstyle) I find to be very intriguing.
I am wondering where one starts with this sort of endeavour - how to test a particular build, figuring out which choices are more worthwhile mechanically, etc.
Can anyone provide a good resource for learning to "theorycraft" in DnD?