Learning music theory is a lot like learning programming (or really anything) in that you can't just frontload the "theory" and then hope to use it. Music theory is important in the sense that it helps you put a name to sounds you like, but it's much _less_ useful as a set of guiderails for composition.

That said, it's still _sort of_ useful in that sense, especially when you're getting started. My advice is to get only the very basics into your mind, and then as you start to branch out, learn what you need as you go. And don't be afraid to break the "rules" - most of the coolest stuff you will hear is stuff that upends some convention, and draws your interest by subverting your expectation.

I think that the best introduction to music theory that you can use to help get you rolling is to learn the concept of the major scale and how to use it to build the diatonic chords of any given key. Signals Music Studio is a really great channel for this, and I would recommend his intro video on the diatonic chords and chord progressions to anyone who's interested in learning more about music theory: https://www.youtube.com/watch?v=M8eItITv8QA

After this, you could try programming some of those chords into a simple tool like Google's "Song Maker" toy, and play with the basic ideas. This is maybe the lowest friction way to "play with music" that I can think of.

https://musiclab.chromeexperiments.com/Song-Maker/

Here is an example where I just programmed a really basic chord progression (Cmaj, Fmaj, Amin, Gmaj):
https://musiclab.chromeexperiments.com/Song-Maker/song/52866...

Here's an example with the same progression, but with a little more interesting arrangement. I threw this together in just a few minutes. Nothing revolutionary, but fun to do! Most of this was not done with any theory in mind besides knowing which notes belonged in each chord of the progression. I also just drew random shit at certain points, and fiddled with it until I liked it.
https://musiclab.chromeexperiments.com/Song-Maker/song/49767...

If you find that you enjoy this kind of workflow, trackers are somewhat similar. You can also go a long way just hand-entering notes into the piano roll in GarageBand or whatever other DAW (Bandlab is a pretty cool online one that is fairly easy to get started with). Once you feel like keyboard/mouse entry of notes is limited, grab a cheap MIDI controller (i.e. a piano shaped computer peripheral for entering MIDI data) and go to town. You can go very far without ever buying any gear or software.

Above all, just be willing to experiment, play, have fun. And cram as much music as you can into your head. If you like something you hear, try to work out what it was that made it cool. See if you can ape that sound, steal it, twist it, etc. There's endless fun to be had in this pursuit and it doesn't take much to get started.

Lastly I just want to emphasize once more that music theory is a descriptive language, whose main use is to help you put names to sounds you like. I found this thing that Bill Wurtz (music youtuber) wrote to be a really great perspective on the use of theory and also a good example of how the game is not to "learn the rules" but rather to find stuff you like and pull it apart to see how it ticks:
https://www.reddit.com/r/musictheory/comments/8n7w5k/comment...