Mend / Guide
Sew a loose shirt button back on
Match the buttonhole and leave just enough room for the fabric it fastens through.

Check what pulled out of the placket
Lay the shirt flat and unfasten the button above and below the loose one. Hold the cloth behind the suspect button and gently tip the button from side to side. Loose thread with sound cloth beneath it is a straightforward resew. If you see a pinhole in each of two positions but the fabric between them is firm, you can usually work close to those marks. If several holes have joined into a slit or the outer layer looks gauzy, sewing straight back through the damaged point may enlarge it. Put a small compatible backing behind the weak area before reattaching, or seek help if the fabric is torn into the placket fold.
Look at the button itself. A chip, sharp edge, or split around a sewing hole could be the reason the attachment failed. Find a spare of the same thickness as well as diameter if the original is damaged. The spare sewn to the care label may be a small sleeve button, so compare it directly with a neighbour. Pass the replacement through the empty hole in your hand to see whether it can turn and seat without scraping.
Find the position with the shirt naturally closed
Fasten the neighbours again and smooth the plackets toward the missing button without pulling the shirt tight. Let the folds settle against each other. For a vertical buttonhole, mark through the slit where the original button would sit in line with the neighbours; compare with any old stitch marks now, while the layers are aligned. For a horizontal hole, check where the button sits when the shirt is gently drawn across its width. The load can seat it near one end of the opening rather than at the centre. Reproduce that working position if it agrees with the old placement and keeps the front even.
Use a removable mark or a loose thread tack you can see when the top placket is folded back. Unfasten enough buttons that the lower placket can be handled alone. Note which way the neighbouring four-hole buttons are stitched. Matching a pair of parallel bars or a cross is a small step, but on a row of plain buttons the difference is easy to spot. On a two-hole button with a decorative face, check the orientation before the first pass.
Allow for the cloth that will sit under the button
The small space beneath a button needs to accommodate the placket it fastens through. Feel an intact button on the same shirt and lift it gently to see its clearance. Thin shirting often needs only a little slack. A thicker folded placket may need a short thread stem, commonly called a shank. If the button already has a built-in shank, sew through that loop instead of trying to add a tall stem underneath it. The goal is for the fastened layers to lie comfortably between the button and its base.
For a flat button, use a fine removable spacer across the face between the holes when you need to maintain a little room. Pass the thread over the spacer rather than dragging the button down against the cloth. On a thin shirt, pick a smaller spacer than you would for an overshirt and compare with the intact buttons. A big toothpick can create extra clearance you don't need; it should not be the default simply because it is at hand.
Reattach a four-hole button on a cotton shirt
Suppose the second button below the collar is hanging by a strand. Its neighbours have two short parallel stitch bars. Snip and lift the failing thread while holding the button away from the shirt, then check that the point you marked falls on firm fabric. Use thread that will pass easily through the button holes and matches the neighbouring bars. Start on the reverse with a small secure anchor at the mark. Bring the needle up through the placket and the first button hole, then down through its paired hole. Keep the bar oriented like the ones above and below it.
Repeat those passes until the button is held firmly without filling the holes, then work the second pair. Move between the pairs on the back, without leaving a large loop. On the face, the two bars should sit at similar heights. Avoid tightening one pair so hard that it pins the button down on that side. In the example, leave just enough room for the thin top placket; compare that clearance to the next button before winding any stem or securing the last thread.
Set the stem and fix the causes of a tilted button
If you used a spacer, slide it out when the sewing passes are established. For a flat button that needs a stem, bring the needle up beside the bundle under the button and wind the thread around the bundle a few times to hold the strands together. Keep the wraps neat and snug without pulling the new stem sideways. Take the needle back through the cloth and secure it on the reverse with small stitches or a knot close to the work. Trim only after making sure the last pass cannot slide loose.
A button can look tilted because one stitch bar is much tighter than the other, the final anchor went off centre, or the cloth beneath it was already gathered. Feel across the reverse for a tight dent. Go back to the affected passes rather than wrapping more thread around a skewed attachment. If the button wobbles excessively on a thin shirt, shorten the slack before making a stem. If the whole placket bows when fastened, check placement against the hole before shortening anything; a misaligned button and a tight shank produce different problems.
Fasten it as you would on an ordinary morning
Close the neighbouring buttons and then the repaired one. Run a hand down the front to feel whether one fold steps sideways or stands up. Open and close the new attachment a few times, turning the button through the slit as you normally do. It should go through with similar resistance to its neighbours, sit flat when seated, and not rock loose when you handle the shirt. Check that the threads on the reverse do not snag a fingernail. If the hole itself catches the button, inspect its edge before assuming the new stitches are at fault.
Wear the shirt briefly and check the line again with your arms forward and then relaxed. The button should not create a new diagonal wrinkle that disappears only when unfastened. After the next wash allowed by the shirt label, compare the stitch bars and clearance again. That check is especially helpful if the old button came off more than once: a fraying hole, weakened cloth, or undue pull across the front needs attention in its own right.