If your broker goes bust, your broker may owe you money if your account was in profit. This means that you are a creditor and your claim will rank alongside other creditor's claims. Your rank will depend on the insolvency laws in the country where your broker is incorporated.
Some countries have implemented regulations to protect depositors. In the UK, the FSA requires that brokers segregated investor funds. In addition, the Financial Services Compensation Scheme will protect you up to £50,000.
Other countries have different rules. For example, Cyprus has its own rules and protection fund for traders.
It's a good idea to check which country your broker is incorporated in before opening an account. Make sure you're familiar with financial protection laws and regulations if you plan to deposit a large amount of money with your broker.
Depends which type of broker. I had a broker go bust on me, Mitton, Butler & Priest around 30 years ago, that I used for option trading. I went to another--Sheppards and Chase, opened a new account with them. The options were automatically transferred and, in the course of the conversation I, also, mentioned that I had cash in my account with them. I thought that that was going to be a loss for me but the broker to whom I was talking to, lifted the phone and got that out, too.
So it goes to show that one should not form one's own, sometimes, pessimistic, opinion, but should ask questions of another broker because they have a system of taking over client accounts when one gets into trouble.