In English, you can turn many adjectives into adverbs simply by adding the suffix -ly. For example, you take the adjective perfect and turn it into the adverb perfectly. Spanish does the exact same thing using the suffix -mente.
As a native English speaker, you will probably recognize many of these adverbs instantly. Words like generalmente and obviamente look and sound a lot like their English equivalents. However, building these words from scratch involves a few minor spelling rules, and putting them together in a list comes with a special quirk that often catches learners out.
When a Spanish adjective ends in -o, you cannot just stick -mente onto the end of the masculine form. You must change the adjective to its feminine singular form first. For instance, to make the adverb for perfecto, you start with the feminine perfecta and then add the suffix to get perfectamente. You use this same pattern for words like exactamente and completamente.
If the adjective ends in -e or a consonant, the masculine and feminine forms are already identical. In these cases, you just add -mente directly to the adjective, as seen with words like frecuentemente or literalmente.
Entiendo la lección perfectamente.
(I understand the lesson perfectly.)
Eso es exactamente lo que dije.
(That is exactly what I said.)
Generalmente ceno a las ocho.
(I generally eat dinner at eight.)
Keeping the accent mark
Usually in Spanish, adding extra syllables to the end of a word can change where the written accent goes or cause it to disappear entirely. Adverbs ending in -mente are a notable exception. If the original adjective has an accent mark, you keep it exactly where it is.
Because the adjectives fácil and rápido have written accents, their adverb forms fácilmente and rápidamente keep them. This helps you remember how to pronounce them, as you stress both the original accented syllable and the -men part of the suffix.
Aprobó el examen fácilmente.
(He passed the exam easily.)
Tienes que actuar rápidamente en una emergencia.
(You have to act fast in an emergency.)
Lists of adverbs
The biggest quirk for English speakers happens when you use two or more -mente adverbs together in a list. In English, you would say something like slowly and carefully, repeating the -ly ending each time. In Spanish, it is considered clumsy and repetitive to use -mente over and over again.
To fix this, you simply drop the -mente from all but the final adverb in the list. The earlier adverbs stay in their feminine singular adjective form. So, instead of saying lenta y cuidadosamente, you say lenta y cuidadosamente. The final -mente applies to both words.
Caminamos lenta y cuidadosamente por el pasillo oscuro.
(We walked slowly and carefully down the dark hallway.)
Resolvieron el problema rápida y fácilmente.
(They solved the problem quickly and easily.)
Summary
To form an adverb, add -mente to the feminine singular form of the adjective and keep any original written accents. When linking two or more of these adverbs with y, only attach -mente to the very last one.