When you appear in Court, the Judge will weigh his or her decision based on a number of factors, including (but not limited to) evidence provided, relevant case law, and the creditibility of the parties. Credibility is how believeable or trustworthy you are. If your story is inconsistent, or you have an unflattering attitude, or if you act like you don't care about the judicial process, this can all affect how the Judge perceives your credibility.
In much the same way baseball fans wore suits and dresses when they went to games 100 years ago, people used to dress very nicely for Court. The problem is, no one expects you to dress up when you go to a sporting event, but it is still expected when you go to Court. Years ago, attorneys would advise clients to wear their "Sunday best," a reference to how people would dress to go to church on Sundays. Of course, many people do not dress well when they go to religious services, let alone Court. Yet, Judges can look at people who are dressed sloppily and take it to mean those people do not respect the Court or the people who work for the Court.
You do not have to wear a suit like an attorney when you go to Court (you can if you like). However, you should always dress in your nice clothing. Business casual is acceptable. For men, that can mean a button down shirt with slacks. For women, that can mean a blouse and a skirt or slacks. You should wear shoes and not sneakers, sandles, flip flops, etc. You can wear a sweater or sport coat if you want.
What you wear to Court should also be a little bit reserved. Remember, you're not going to a club, so stilleto heels, mini-skirts, bright suits, too much jewelry, and other similar fashion options should be avoided at Court. Avoid wearing anything too gaudy or potentially offensive. Bathe in water, not cologne or perfume.
If for some reason you simply do not have a nice shirt or other clothing, then you should wear your nicest outfit. Your footwear should be as clean as possible. No stains on your shirt. No outrageous t-shirts. No holes in your jeans. Don't chew gum or wear sunglasses. It's basic common sense. If you want people to take you seriously, then dress like you're serious.
Many people have to go to Court in their business outfits, like a jumpsuit, because they have to go to work before or after their hearing. These things happen. When you get before the Judge, you can make a simple comment apologizing for your appearance and explaining why you had to appear in Court that way (or if you have one, ask your attorney to do so for you). No Judge is going to have a problem with people who need to work. If you acknowledge it, the Judge will understand. Of course, if you have the time to go home and shower and put something nice on, you should do so. If you are in the military and have the option to wear something besides fatigues, that is great. Otherwise, it is always better to go to Court than not show up at all.
How you dress is not the biggest issue in your Court case. However, if you show up looking your best and your opponent arrives in sweat pants and crocs, you have already started off on the better foot.