The World of Warcraft API has a list of functions that you can interact with and to talk with WoW using Lua. These are your building blocks for manipulating WoW windows and chat boxes and so forth. Looking at these for the first time can be very daunting. But don't be discouraged. After getting more familiar with Lua the WoW API gets much easier, and the documentation gets much easier to read. Keep in mind there are many different ways to accomplish your goals, so when going though the API keep looking until you find a way that best suits what you need.
As late as possible. Early on, you’ll want to follow the missions in Battle for Azeroth right up until you get the option to send a follower on a two-hour long quest. As soon as you get there, stop doing the War Campaign missions. You can come back to them once you have reached something like 119 and a half and finish leveling with those if you want. If you don’t use these missions to cap off your leveling journey, then they’re the first thing you’ll want to do once you reach max level.