A cookie is simply a technology for remembering something about you.
Without cookies, a website is like a goldfish who loses its memory every time you visit a new page. Once you visit a new page, it doesn’t remember who you are.
Now this can be a good and a bad thing. Without any memory, a website can’t do a lot of stuff. It can’t let you log in, because it forgets who you are. It can’t let you buy anything, because it forgets what you’re buying.
Cookies aren't automatically good or bad, but it’s worth understanding what you can do about them.
You can turn them off completely, which is a bit like banning all music to prevent another Justin Bieber album. Many websites simply won’t work.
A better option would be to turn off 3rd party cookies, which will stop most websites from sharing information about you. Some browsers – like Safari – do this automatically.
And finally, you can take a deeper look into any websites which concern you. Most websites have policies that explain what they do, if you care to look.