A cookie is a small data file that a website stores on your computer. These files only contain data - they do not contain anything that can cause harm to your computer.
Cookies are used to remember information about the users of a website so that their experience is improved when they are using the site and when they return for subsequent visits.
Some cookies only exist while you are on the website - these are called 'session' cookies while others are stored on your computer even when you have left the website and are then only used by the website when you come back - these are 'persistent cookies'.
Cookies either restricted to the domain of the website that you are on - these are called 'first party cookies'. Or cookies are set by a domain external to the site, often for analytics - these are known as 'third party cookies'.