Task Custom Fields - Create and Update

How to create or update a task with custom fields