I often find myself guessing based on what I have on hand. Are there some objective guidelines for how to select the proper size? I'm usually thinking about three attributes:
Length
Length is probably the easier dimension to eyeball, but I imagine there is some logic there I could be applying to be more consistent.
Diameter
Diameter is more difficult. Generally the gripping strength is best achieved by increasing the depth of the hole (+ fastener length), meaning a long skinny screw will hold tighter than a fatty short one (provided we don't go to the extremes). My best guess is to use thicker screws when shear resilience is needed, where the weight of the workpiece or the way in which it is to be used will result in lateral force against the screws. But again, I always make my best guess.
Thread Pitch/Depth
This one is easy at a high level. Harder woods need a narrower thread pitch, softer woods need a wider thread pitch (and deeper threads). Usually I only have two choices (sometimes fewer), but perhaps every type of wood has its ideal thread profile.
But really this all boils down to guestimation, which I already do. What about more objective metrics I could put on a cheat sheet somewhere in my shop (or better yet, something I could remember)?