A pencil case is one of the easiest and most useful things you can sew. You only need two pieces of fabric and a zip. Cut the fabric about one inch longer than the zip. I usually use a 7 or 8" zip. The height of the fabric depends on how deep you want the pencil case. I'd recommend about 5". So if i was using a 7" zip I'd use 2 pieces of 8"x 5" fabric. Put the zip and one piece of fabric facing each other so the right side of the fabric is facing the top of the zip like in the photo.
Sew together. You may need to use a zipper foot on your sewing machine. Add the other piece of fabric to the other half of the zip in the same way, right sides together, sewing on the wrong side.
Now half open the zip and put the right sides of the fabric together so that your pencil case is inside out. If you have be using a zipper foot you can put the regular foot back on. Sew the fabric together about 0.5" from the edge. Where the sides meet the zip be careful not to jam the machine, you may need to change the foot or hold the fabric very flat and taught. You can turn the pencil case right side out through the open zip.