First - pinworms are too small to see. The lab exam looks for them with a microscope. You press a piece of sticky tape against your anus in the morning, put it on a glass slide and take it to the lab.
When you pass gas it carries small bits of fecal material with it. This can be very itchy around the anus. When you have a bm it also leaves some feces around the anus. I keep a plastic container in the bathroom and wash after a bm or whenever I itch. I wear a plastic glove on the hand used to scrub off the feces.
Some people react to hot peppers with itching/burning around the anus.
Put 'itching anus' in your browser and you may find some more help.