Not earning money is not a failure. Wasting time on non-free software the purpose of which is making money - now that's unfortunate.
My advice to that guy would be:
* Write software you need personally. You will at least have one happy user - and if you write something you like, other people will probably want to use it too.
* Think of the software needs of people you know - in your family, physical community, or online communities - and see whether you can't help implement it or adapt/improve existing software for that purpose.