Beginner need help

Hi,
I try to make a same logic in unity with if and else but I can’t do it. If I well understood cast failed isn’t a else. If person can I help me please