Hi,
A simple approach would be to create a custom field of the table "order" and of the type "checkbox" via the menu Display>Custom fields.
In its settings, you can restrict it based on categories so that it will only appear when at least one product of the categories selected in the custom field is in the cart.
And you can make it required with an error message, etc.
It would be displayed by the "fields" view of your checkout workflow.
Note that this requires HikaShop Business.
Now, it's possible to do it with custom coding but if you're not skilled with it, it will be much faster, easier and cheaper to do it with a custom field. Even I would prefer doing it with a custom field than writing the code.