If the screen on your iPhone 5S is cracked and it’s not under warranty, you can either live with it, get a new phone, take to a shop, or as I’ll show you, fix it yourself.

Should I do this myself?

Before undertaking this DIY project, I suggest you watch my video on what to know before trying to fix a smartphone or tablet and then decide if you should repair the phone yourself or have someone else do it.

Also, if you have an AppleCare+ or other warranty that covers accidental damage, just get your phone fixed or replaced under the warranty. Even, if your phone is out of warranty, Apple will replace the screen in-store for $149 (US) and the entire phone for $269.

But if you’re ready to tackle a challenging, but satisfying do-it-yourself fix and perhaps save a little money, here’s a guide for replacing a cracked display.

For more teardown photos of the iPhone, iPad, and other tech, check out my Cracking Open blog on TechRepublic.

Get the replacement parts and tools

Before beginning the repair, you’ll need to get the necessary replacement parts and tools.

The iPhone’s front panel and LCD are fused together, so I recommend buying both as a single unit–most parts providers only sell them this way. You’ll find them anywhere from $50 to $150 dollars online. Just be sure that you buy the right one for your phone, and read the reviews of people who have installed them. Not all replacement screens are made to the same tolerances as the original part. I also suggest you buy a replace screen with the front-facing camera, earpiece, and sensor assembly already attached.

The Home button is another story. Very few, if any, replacement screens come with the 5S’s fingerprint scanning Home button. Before installing the new screen, you’ll need to transfer the button from your old screen to the new one. But we’ll get to that in a minute.

As for tools, you’ll need a few thin prying tools, tweezers, Phillips 000 screwdriver, suction cup, and a special pentalobe screwdriver, for removing the phone’s outer case screws.

In this guide, I’ll be replacing the panel on an AT&T iPhone 5S, but you can use same basic steps on phones from other carriers and, with the exception of the steps relating to the Home button, on the iPhone 5 and 5C.

Lastly, know that by following these instructions, you do so at your own risk. And remember to backup the data on your phone before starting the repair.

Step 1. Eject the SIM card

With all the prep work finished, we’ll start the repair by ejecting the SIM card.

Step 2. Remove the broken display

Next, remove the two screws located along the bottom edge and gently lift up on the front panel using the suction cup and a prying tool if necessary. Take care not to pull the panel too far.

Before completely removing the panel, we’ll need to disconnect several cables, starting with the one for the Home button, which is covered by a small metal bracket.

To disconnect the other cables, we’ll need to remove a metal shield on the upper portion of the motherboard.

Finally, we can detach the panel’s three remaining cables and completely remove it.

Step 3. Transfer the Home button

Before we can install our new panel, we need to transfer the Touch ID enabled Home button from the old panel to the new one.

So first, remove the single screw that secures the button’s cable. Note the position of the small contact under this screw. It will need to be in the same position on the new panel.

Next, very gently fold the cable down so we can access the metal bracket underneath.

Now, remove the two screws attached to the bracket and the bracket itself.

Finally, comes the most delicate part of the process. Very, very carefully pry the Home button cable away from the panel, followed by the Home button.

You may need to apply a little heat to the soften the adhesive as you remove these components. You may also need to push up on the button from the front of the panel. Just be gently and go slowly.

With the Home button removed, we can place it on our new panel, re-attach the bracket, and reposition the cable.

Step 4. Install the new display

We’re now ready to install the new display. So, reconnect the cables at the top of the panel and replace the metal shield. Then reconnect the Home button and reposition its metal bracket.

Lastly, press the new panel onto the frame, secure it with the two pentalobe screws, and power up the phone to make sure both everything is in working order.

Congratulations, you fixed your phone!

As fixes go, this one isn’t too tough, but it does take a lot of patience and attention to detail.

For more handy tips and tutorials check out CNET’s How To section. And to see more teardown photos of the iPhone, iPad and other gadgets, check out my Cracking Open blog on TechRepublic.