How to define a loss function in the multi-task training

Hey I intend to finetune a DNN and make it output two things: one is for regression problem and another is for classification problem?
How to define the loss function and is there any useful tutorial that you can recommend to me?
Looking forward to hearing from you!
Many thanks!