That’s a really broad question.
The specifics of how to do it will depend on the language and/or library you’re using.
In general: you’ll get a task object in whatever way you do and it will contain an array of custom field values for that task, as described here in the docs. Each of those values will include the
id of the custom field. Take that
id and call the
/custom_fields/custom_field-id endpoint (where you put that
custom-field-id in that call) as described here in the docs to get the metadata for that custom field (its name, type, and possible values for an enum type).
Also, be sure to read and understand the overall discussion of custom fields in the docs here.
Feel free to follow up with specific questions if you have them; I think the above is about all I can offer at a very general level.