yeah forgive me. i confess that i didnt realize you meant actual music theory. to be honest, what would be best is to take lessons and/or theory classes. one of these responses suggested a place you can get theory learning materials – if you’re really ambitious and disciplined you could definitely teach it to yourself.
i’d suggest having a piano because it’s one of those universal instruments that help you learn music theory effectively and what’s more, theory often uses piano concepts to help you learn. you can understand sharps and flats, keys, modulation, chords, scales, etc. with piano pretty easily.
once you learn the basics (which usually takes at least a year) you can learn to do things like write music, write 4 part harmonies and stuff. doing it in a class setting is great cuz you can train your ear with sight singing. good luck!