The short answer is to lift consistently and manage your macros closely. You’ll need to sleep/recover avoid other body stressors because if you don’t eat enough and recover, no muscle. Working out and food choices need to pass the realm of willpower and move to the realm of subconscious habit. I used MyFitnessPal to really learn about food and macros. Eating clean should always be a priority.
I suggest you change your newsfeed and start following a lot of serious fitness content. Reading that content will put fitness in mind consistently.
Sources like Flex will teach you aesthetics and body building which will focus on hypertrophy but this is the extreme realm where different steroid routines are the norm even if not always directly talked about. Steroids aren’t a panacea though because they still require you to work out, eat well, and recover. They can speed up the process maybe 4x and raises the ceiling but they are fraught with health, legal, and other sport consequences and can veer into unhealthy fixation. Nonetheless these bodybuilders know everything about activation of different muscles, i.e. what shoulder moves to do to get them to pop like a superhero. Bodybuilding.com has a lot of info as well and focuses on supplements. These are people who compete entirely on pretty muscles and posing and know more about getting “shredded” then anyone else.
Move over to the other end of the spectrum, powerlifting, weightlifting, and strongman offer ways to build muscle with a much more impressive strength factor to go with it. I feel like this is a better way to just gain a base of lean mass. These guys build a ton of muscle and often shed excess fat because they compete in weight/age groups. Admittedly, sometimes you’ll see fatter looking guys but realize they’re just prioritizing recovery/muscle feeding and care much less about aesthetics for performance reasons. Barbend is a great place to start reading about these three sports and you’ll see they are actually everywhere. Powerlifting and strongman workouts tend to build a sizable/functional muscle foundation if you just want to gain some initial mass. I like Stronglifts 5x5 app as a good free app/program to get started. You can always pivot to bodybuilding style workouts later but building strength/mass like powerlifters means your eventual bodybuilding workouts are safer and more scolulping oriented while your powerlifting workouts provided raw mass, stability, and bone density. Weightlifting is a different sport that involves more explosiveness and technique work. It’s awesome but won’t build mass quite as focused as the other two.
Cardio is good for warmups and to maintain some conditioning but it’s usually the best way to lean out not get mass. HIIT gets closer but is just a different kind of conditioning with a little more bulk to it.
Crossfit/functional fitness is in between. It’s awesome for overall conditioning but is a compromise between the type of conditioning you get from hard core cardio and strength sports without being as good as either. Along these lines, some MMA programs, advanced calesthenics /plyometrics, or certain sport focused programs will build this overall fitness concept but not specialize in specific results as fast as possible.
I finished 6 months of powerlifting and am moving into a calesthenics/gymnastics/body weight program called Thenx to master some things I couldn’t do before because I needed more strength.
Hope this helps. Building muscle takes time. I suggest committing to a program for 6 months and tweaking it until you make it work if you want to have a chance at a real transformation. Good luck with wherever your fitness journey takes you.