Information about circumstances of losing a job can go from these separate sources:
HR department of your company
In most companies, HR (if requested in writing) will release only date of start and end of work, and your title. They do it for lawyer's reasons: not to be sued by former employee. You can bet that it happened.
Even if company considers hiring a certain person a mistake (and that person is marked "do not rehire"), they have no reason to share that information with other companies (because other company may save money by not repeating same mistake, but for original company releasing anything above dates has only downside: risk to be sued). So you have nothing to worry from HR.
Manager, if he has time to talk to recruiters and HR of your new company, may release more information, but they are also trained to not to badmouth former employees. It is trivial to ask your friend to pretend to be a recruiter and call up your manager to ask about your job performance (and sue the company if you think you may win the case).
Your reference in the company
You pick references yourself. Do it wisely. Your reference from your former job can be someone who worked for you (and was happy with the work you did), even if your immediate manager was not. There is plenty of resources on exchange about managing (and not overusing their time) your references, reminding them what you did etc.
So it is back to you.
You need to be clear why you lost your job. Was it personality mismatch? Move following your spouse? Technology they used or switched to was not what you think about your career should be?
Every company thinks that their technology is better than others.
New company is very interested what you learned and what you plan to do so this time it will be different. Small teams fit better your personality? Big company has more resources for training and tuition reimbursement? Waterfall process in big company is too confusing, you want something more agile? Startup allows you to have more hands-on experience?
Make sure that new company can provide what you missed in previous position. (Ie don't expect tuition reimbursement from a startup.) They are as interested of hiring someone who will fit into new position and prosper in it, as you are interested in finding a job. Hiring process is costly, they want to avoid unnecessary costs.
But of course as others said, not having currently a job is red flag. Having any temporary project is better than none. But not having a job, and not knowing why you lost previous and how you plan to succeed in new job is deadly.