This is very easy and fast way of drawing settings icon. You need only the star tool and change the live corners > chamfer type. Depends on your need you can make a hole in your star shape.
Here is the video showing how to create cogs wheel icon:
https://www.youtube.com/watch?v=mecb4N9Mq0U
illustrator gear logo design | cog wheel or setting icon