The types were designated by configurations of their wheels. For example, a 2-8-4 engine had two small guide wheels in front, eight giant drive train wheels middle, and four small support wheels under the cab where engineer and fireman operated the locomotive.
I learned all of this, of course, while researching for my book, GRIT, co-authored by William Maltese. If you read the excerpt which accompanies the book on its publisher's web site, MLR PRESS, you will see that one particular type of engine, a 2-10-2, had some issues when first put into service. The incident is fiction, but the problem and solution was very real.
I found one of these locomotives on display at a museum and snapped a picture of its drive train wheels.