It’s important to encourage your friend Josue while also acknowledging his concerns. A supportive response might be:
"Hey Josue, I totally understand your worries about writing an algorithm. It’s completely normal to feel that way, especially if you’ve had some tough experiences before. But remember, making mistakes is a part of learning. How about we work on it together? We can break it down step by step, and if something doesn’t work, we’ll learn from it and improve. You’ve got this!”
This way, you validate his feelings and offer to help him, which can boost his confidence.