Welcome to the Community.
I have a couple links and a video that will show you how to build your new stair railing. The first link is to a Project Guild for Replacing Stair Railing. The next is to the general Project Guilds for Decks. Both have great step by step guilds. The project guilds for decks have everything from planning it to maintaining it.
Here is a video to show you how to install deck and stair railing. The video shows how to notch out the post so that it rests on the stair. This is how I prefer to install a post. In my opinion it is a lot stronger that way instead of just installing it flush. They used a nail gun to install everything but I personally use galvanized lag screws and washers to install the posts to the deck and a nail gun or weather resistant screws for the rest.
There is also a really good book that Home Depot sells called Decks 1-2-3. It has step by step and also illustrations for each step. You might want to stop by your local store and check it out.
If you have any other question please let me know. The Community is always here to help.