Underwriting is not universal. There are generalities and various "common knowledge" related to credit scores.
In general, the lower your balance relative to your available credit (known as credit utilization) the better your score. There is the obvious path to low utilization, and that is maintaining a low balance. The other route is pushing up your available limit.
The blind spot of credit score is income. Your credit score has no way of measuring that you have available credit equal to your annual income, meaning you could easily dig a debt hole that would be extremely difficult to climb out of.
When you go to a bank for a loan, the underwriters look at you in a more holistic manner. Credit score is a reasonably good initial low resolution filter. If you can't pay your minimums and have a credit score of 550 you're probably a bad risk. But a credit score of 750 doesn't mean you are necessarily a good risk. A "good" score just indicates that you are generally conservative enough in your assumption of credit to keep everything within your ability to make minimum payments consistently. BUT, when you go through underwriting, they're going to look at your income, your employment, your employment history, sometimes your assets, etc.
There are some pretty highly commoditized loans like car loans by manufacturer subsidiary lenders. They're really just taking employment information to have somewhere to look for the car if they need to repossess it. Mortgages got like this in to the runup of the 2008 crisis and lenders have tightened up, generally, as a result. Stated income and no employment history generally won't cut it regardless of your credit score.
Is an unused credit card good for your credit score? Generally, yes.
If your total available credit is too high relative to your income could that negatively impact your underwriting outcome on a loan? Yes.
Most of all, remember to arrange your finances in a way that makes sense for you. The general guidelines for attaining a "good" credit score should really be viewed as the pitfalls to avoid. First and foremost, don't make late payments, don't max out your credit card(s), etc. Don't go get a store credit card because the internet said a mix of credit is good for your credit score or second guess paying off a loan early because it might have some impact on your score.
If you have $50,000 of available credit with $5,000 appearing as a balance. you have a 10% utilization. If you cancel one of the cards that has a $10,000 limit your utilization will change to 12.5%. Is that going to change your score? MAYBE. Is it going to matter? Probably not. Maybe your score goes from 750 to 740, who cares.
"Never cancel a credit card" as a blanket statement is bad advice and it's written all over the internet. Mostly perpetuated by people who also don't realize "department store cards" are all but extinct and have been replaced by co-branded credit cards.