In everyday parlance, “substance” means an individual entity or thing (e.g. Socrates, or Alexander’s horse Bucephalus, or the General Sherman Tree, or the first living cell, or the Hope Diamond, or an electron, or a photon, or a quantum field), while an accident means a property of a thing. Aristotle distinguished no less than nine categories of accidents which we can apply to individuals, such as Socrates: (1) quantity (e.g. 70 years old when he died); (2) quality (e.g. bald); (3) relation (e.g. the husband of Xanthippe); (4) location (e.g. in Athens, Greece); (5) time (e.g. died 2,418 years ago); (6) position (e.g. standing); (7) state (e.g. sedentary); (8) action (e.g. walking around during his final hours); and (9) passion (e.g. being poisoned to death). However, it’s not known how Aristotle came up with his list of ten categories (substance plus nine categories of accidents).
The fundamental distinction between substance and accident is that whereas the former can be conceived and understood in its own right, the latter cannot: an accident is a property of a substance. Accidents are said to inhere in a substance - a term I dislike, as it suggests that accidents are part of a substance, whereas in reality, they occupy a lower level of reality than substances.
Some material substances (e.g. water) are treated as uncountable in English; however, Scholastics would say that even in these cases, we can identify true individuals, although opinions differ greatly as to what these individuals are (e.g. is a lake an individual entity, or is it merely an agglomeration of water molecules, which are the true individuals in this case?). Regarding man-made objects (e.g. a car). it is generally agreed that these are not true substances, as the parts have no inherent tendency to work together. Scholastics view them as agglomerations, with a purpose imposed on the underlying substances by the human designer. Regarding abstractions (truth, justice, the number two): while we might attribute properties to these entities (e.g. the number two is even), they are not endowed with existence, as natural substances are.
Finally, it needs to be understood that although a substance can be conceived or understood in its own right, this does not mean that it can exist independently of everything else. (It was Spinoza who made the fatal mistake of supposing substances to be independent, in addition to being intelligible in their own right.) For instance, I can know what a hydrogen atom is, without having to understand anything else; nevertheless, the fact that a hydrogen atom is contingent and composite tells me that its existence is not self-explanatory, and that it requires something else to maintain it in existence.
Scholastics tend to treat qualities and potentialities as ontologically primary: here, I believe they are mistaken. Qualities (e.g. yellow) are analyzable in terms of actions (e.g. emits light with a wavelength of 589 nm), while potentialities, whether active (e.g. able to throw a punch) or passive (e.g. able to be punched) are analyzable in terms of underlying actualities: a boxer like Ali is able to throw a punch because he is actually muscular and has bones and joints, while he is able to be punched because he has flesh, which can be bruised, cut or otherwise damaged. For my part, I define substances as natural agents, and accidents as actions of natural agents - but that’s just my own personal view. Cheers.