Question: Suppose I have a method that returns an array or list or some other collection. If something goes wrong inside or when there is simply no data to return, what is better - to return null or to return array (list, etc.) that has length (count) equal to 0?

In fact is it important, or it is just a matter of developer's preferences?

Answer: 
Your iteration code will be a lot easier if you return empty collections instead of null. 

However, it may be important to distinguish between an empty collection and no collection of data, so it depends on the semantic of the actual type.
If something "goes wrong" you should throw an exception. If there is no data to return, return an empty collection. Developers generally should not be surprised with a `NullReferenceException` when they ask for a list of items and there just happen to be none to return.