When is it ok to tap out of a workout?

Today’s workout was rough! My performance was so weak and I honestly think I might’ve been coming down with a cold during my workout today. I did push through the whole video but I honestly don’t know if it was worth it. Please enlighten me about when it’s ok to not finish a workout and is it worth finishing a workout when your not giving your all?