Trial and error. Read books, forums etc. While I go by the “there are no rules” formula, it’s good to have the basics covered. There are many good books out there on recording and mixing. I learned a lot myself form hanging, asking questions, and helping people at the Andy Sneap forum. There are a lot of tutorials there that are great!