It works as any other ability check
When a character tries to craft something using tools, he/she must have the respective proficiency in order to succeed:
You must be proficient with tools related to the object you are trying to create (PHB p.187)
This is related not only to crafting:
trying to open a lock requires proficiency with thieves’ tools (PHB, p.175)
DM asks the player to make an ability check. All the attributes - ability modifier, time, DC, possible negative results - are set by the DM.
Possible use cases depend on the tool. For Artisan's tools they might be:
- crafting an item
- repairing an item
- modifying an item (i.e. tweak armor size, if you use "Variant: Equipment sizes" rule)
- helping with craft
- appraising other's work
As a DM, normally you choose DC according to the following list:
Trivial (DC 0) A task that is so easy that isn't worth a check. An adventurer can almost always succeed automatically.
Very Easy (DC 5) Requires a minimum level of competence or a bit of luck to accomplish.
Easy (DC 10) Requires a minimum level of competence or a bit of luck to accomplish.
Moderate (DC 15) Requires a bit more competence to accomplish. Can be completed more often than not by a character with both natural aptitude and specialized training.
Hard (DC 20) Include anything beyond the capabilities of the average person without aid or exceptional talent. Even with a bit of training and skill you still need some luck to pull it off (or maybe some specialized training).
Very Hard (DC 25) Achievable only by especially talented individuals. Nobody else should even bother trying.
Formidable (DC 30) Achievable only by the most trained, experienced, and talented individuals, and they probably still need help to pull it off.
Speaking of crafting time, normally it takes days
From the PHB, p. 187:
For every day of downtime you spend crafting, you
can craft one or more items with a total market value
not exceeding 5 gp, and you must expend raw materials
worth half the total market value. If something you
want to craft has a market value greater than 5 gp, you
make progress every day in 5-gp increments until you
reach the market value of the item. For example, a suit
of plate arm or (market value 1,500 gp) takes 300 days
to craft by yourself.