If you have crashed in your helmet, replace it. But helmets are also a piece of wearing apparel, and in daily use they can be worn enough to need refurbishment or replacement of fitting pads or other parts, and if the buckle breaks you need to fix it immediately. Here are some suggestions for the things you can fix. The most serious widespread problem with helmets is breakage of plastic buckles. If that doesn't work, see your local bike shop, or try a mail order house if you don't find it there.
Most local shops have some of the more common plastic replacement buckles.
The thread, stitching pattern and stitching technique to produce a durable strap repair are very specialized, and best done by the manufacturer. Contact the manufacturer about a repair or to order a new strap assembly from them. Be ready to replace the helmet if you can't get them to do it. Chances are the strap has seen a lot of use before it needs replacing, so you may need a new helmet anyway. You must replace any helmet that has been crashed.