You can get rid of gnats by using some vinegar and few drops of dish soap in a bowl to create a homemade gnat trap.
The vinegar will attract the gnats while the soap will kill off the gnats.
Place the homemade gnat trap where you'll be hanging out outside or anywhere else.
Dryer sheets, Pine Oil, Vanilla, and Citronella are all good gnat repellents too.
Look around your yard and if you find anything that has stagnant standing water in it then pour the stagnant water out to avoid it being used as a breeding grown for mosquitoes and gnats.
Clean up any yard debris as well where gnats and mosquitoes like to hang out.