Locate the place where you would like to change the key signature and move backwards in the score to find the preceding key signature. In some cases, this will be the starting key signature. The prior key signature affects how you notate the next one, so either write it down or remember it.
Write in the new key signature at the beginning of the line. Compare it to the previous signature. If any notes were sharp or flat in the preceding signature, you will need to note a natural sign on the same line or space in the new signature. If this affects only one or two notes, though, it might be simpler to just put a natural sign beside them each individually.
Write in the original key signature at the end of the line. The catch is, it may look different than it did in Step 1. This is because, again, you will have to note any former sharps or flat notes you are now making natural.