Yes! They had to study a subject called "orchestration." Texts on that were not written until the Romantic period. Though many did just play the instruments or have family/ friends that they could ask. They did get to know the capabilities through listening to the instrument play and timbres or tone color and effects got more and more interesting as the instruments and writing capabilities developed. Operatic and vocal music was the most dramatic and evocative.
How do classical composers write music?
2 Answers By Expert Tutors

Dallas H. answered 04/21/19
Music Instructor/Tutor (Theory, Composition, General Music)
Hello! Composers have used various methods for writing music throughout music history. While composers such as Mozart and Beethoven may have been musical geniuses, they still extensively studied music and were well trained in a variety of areas. The field of learning how to write for various instruments is typically referred to as orchestration, and this is something that is still taught to music students today. Many composers also studied other areas relating to composition (such as counterpoint, harmony, part-writing, aural skills, etc.) and these subjects are also taught to an extent in modern music theory courses. Hopefully this answers your question!
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.