You can buy spline (the rubber seal), a spline rolling tool, and screen at any hardware store. Typically, you can only by screen in big rolls, which you'll then cut down to size. Fiberglass screen will give you a chance to start over if you mess up. Aluminum will hold up to more, but it tends to take on the shape of whatever you're doing. That means you won't get a chance to try again if you make a mistake. If you have pets, consider using pet screen, which is meant to hold up to the weight and claws of your pets. It should come out easily. If it doesn't, use a screwdriver or the back of a hammer to help pry it out. Lay the screen down on a flat surface so you can work on it, preferably a work table that you can screw stabilizers into. If you need to replace the frame, too, you can buy the sides and corners at a hardware store. Just measure how long the sides need to be, and then pop them together with the corner joints to create the frame. You'll only need to replace the frame if it is bowing severely or rusted out. The spline is the black rubber seal holding the screen in place. It looks like a black cord, stuffed in the edge of the frame. Use a screwdriver to help pry it up, and then pull it out. Pull up the screen once the spline is out. Grab one edge of the screen and pull it out of the frame. It should come out easily now that the spline is gone. Don't try to reuse the spline. It gets old and brittle after a while. Scan each corner of the frame for a spline end. Once you find the end, slip the screwdriver underneath and pry it up. Slowly pull the entire spline out from around the window frame. The spline may be cut in sections. If this is the case, just repeat the process until the entire spline is out of the window frame grove. Lay the roll of screen over the window frame. Cut the screen so you have 2 inches (5.1cm) or so of excess on each side. The extra screen gives you room for mistakes. Plus, the spline will take up part of the screen. Screw a piece of wood to your work table on the inside of the frame along the long side. The piece of wood can just be a scrap you have lying around that's at least 2 to 3 inches (5.1 to 7.6cm) long. You're just using it to brace the frame; don't screw it into the frame. Pull the long side taut against it, and screw in another wooden piece across from it along the other long side. These pieces will keep the frame from bowing in as you work. While this step isn't absolutely necessary, it does help the frame keep its shape. The clamps hold the screen in place against the frame. In addition, they ensure that when you are rolling in the spline on the other side of the screen, the screen will remain taut. Use enough clamps to hold the screen in place. Using the convex end of the roller tool, run it over the screen on the side opposite the clamps. Push the tool and screen into the frame's groove. Just do one of the long sides for now. After you roll the screen in, look down the screen. Make sure that there are no bubbles in the screen. If bubbles are present, remove the screen and roll it back in, ensuring you don't have any bubbles this time. Work from corner to corner. If your screen has lift tabs, small plastic handles to help remove the screen, place them in the track before you pre-roll the screen. You want these tabs to be on the opposite side of the spline, so that when the screen is put back into the window, the pull tabs will be on the inside of the house. Lay the spline on top of the frame track where you just pressed the screen in. Press the roller tool over the spline, and run it along the edge, pushing the spline seal into place. Rolling the spline in may take several passes but make sure at the end that the screen is all at the same depth in the track. Take your time with this step. If you go to fast or push too hard, the screen may rip on the inside of the frame and then you have to start all over. Screening is a slow patient process; take your time and do it right the first time. Take the clamps off the screen. Stretch the screen over the frame so it's taut, and then press the screen into the frame's groove with the roller tool. Apply the spline, and press it in as well, using the other side of the roller tool. If you're using fiberglass screen and you mess up, you can pull it out and do it again. If you're using aluminum, you'll have to cut new screen if you make a mistake. Pull the screen tight over the frame on one edge, and roll it into place. Roll the spline into place, too. Do the same on the other side, avoiding wrinkles as you go by pulling it as tight as you can. Cut off any excess spline first. Lay the knife flat on the top of the spline, and direct the blade towards the frame.Cut along that edge to trim off the excess screen. With a screwdriver, tuck the spline in at the corners if it's sticking up. Just press down with a screwdriver so the spline will stay nicely in place. Make sure you use a sharp blade, as a dull one will just drag the screen along, not cut it.

Summary:
Purchase the materials you'll need. Pop the screen frame out of your window. Pull up the rubber spline and take the screen out. Cut out a section of new screen. Use stop blocks to hold the frame in place. Place 2-4 clamps on one long side of the screen. Press the screen into place along the opposite side with the roller tool. Use the concave side of the roller tool to press the spline into the frame. Do the opposite edge the same way. Repeat the process for the other 2 edges. Slice off the excess screen and press the spline into the corners.