To make a security code you need to enter the routers address into the address bar on your browser. Chances are that it's 192.168.1.1 but you can find it easily by looking on the bottom or side of the router, the users manual or the web page of the brand of router that you have.
Once you enter that address you will get the routers log in window where you will put the user name and password of the router. That information can also be found on the web page or in the user manual of the router.
Once in the routers internal settings go to the wireless page and select the wireless security sub menu and that's where you can make a security key using one of the routers key generators (WEP , WPA or WPA2) , WPA2 would give you the best security key strength , also this is where you can view the security key once it's made.
Write down the security key and save it in a safe place for when you may need it.
Save your changes and exit the routers settings.
If you need the password for your network then on any computer that is currently on the network go into the ciontrol panel and select Network and Internet , then select HomeGroup , then select view and print the homegroup password and the next page will have your homegroup password.