Yes, there were many, many indicators that Thomas Cook was in financial trouble, from analyst downgrades to their share price and their bond rate. But the company had been in financial trouble for years, being slow to address its competition as its bread-and-butter businesses were stagnating. They hadn't paid a dividend since 2011. In terms of operational trouble, I doubt travelers could have predicted that the collapse would come on 22 September, certainly when their suppliers and employees did not.
This is true of most major corporate collapses. There is no such thing as announcing a liquidation even a day in advance—your landlord would change the locks, your employees wouldn't bother to show up, the banks would withhold credit card payments, and so on. You're effectively shut down the moment you make the announcement, and that always comes as a "surprise," even when long suspected. So it was with Ansett, Swissair, Varig, Mexicana, and more recently Monarch and WOW air, not to mention companies like Toys R' Us or Northern Rock.
If a company can convince investors, creditors, and regulators that it is improving its operations and balance sheet, it may be able to operate for years and years until it records a profit again, or until the day one or more of the stakeholders is no longer convinced the project is viable. Pan Am made losses for 22 years before closing down, and even in its shabby reduced state might have survived for longer without the Lockerbie bombing. U.S. department store Sears, Roebuck & Co. has been in serious trouble for a decade, and in decline for at least three decades. Many analysts, in fact, have called for its liquidation. But in the meantime it has still sold billions upon billions of dollars of merchandise and employed tens of thousands of people. You can order merchandise from them today and expect it be delivered tomorrow—until the tomorrow finally comes when it is not.
Thomas Cook is a storied name and the company collected a billion pounds of revenue last year. It could roll over its debt and attract new capital until the day arrived that it couldn't. Even their much-publicized £1.5bn loss earlier in the year is a matter of accounting. United Airlines said it lost a staggering $16.7 billion in the fourth quarter of 2005 right before they exited bankruptcy protection.
If a small local carrier goes out of business, you are stranded unless you have specifically purchased insurance against that scenario. For major airlines, however, there are usually provisions negotiated whereby another airline will honor at least your return ticket, at its convenience. Based on cursory reading about the high-profile collapses I listed earlier, I cannot discern any pattern of who will accept those bookings. You will need to wait for the news to come out when it happens and contact the relevant airlines for arrangements after the fact.
As far as unused tickets on a carrier that has ceased operations are concerned, some discussion of protection has been covered in Insurance against airline bankruptcy, WOW air has ceased operation, can I get my tickets refunded?, and What happens to plane tickets in case of airline bankruptcy? Travel insurance may or may not include a provision; you will need to read the fine print to see if you qualify. If you purchased from the airline with a payment card, you may be able to contact the issuer of the card to request a refund, since the carrier has failed to hold up its end of the contract. Additional protections may also apply depending on national laws based on how the trip was packaged and sold.