Portuguese builds many adverbs the way English uses -ly: you add -mente to an adjective. Lento gives lentamente (slowly), feliz gives felizmente (fortunately), perfeito gives perfeitamente (perfectly). There are two catches. First, the suffix goes on the feminine form of the adjective, so it is lentamente, never lentomente. Second, the written accent on the adjective disappears: rápido becomes rapidamente, and fácil becomes facilmente.
English speakers tend to trip over both points. English has no gender, so the choice of -a feels arbitrary. The dropped accent also looks like a spelling mistake until you see why it happens.
Take the feminine singular form of the adjective and add -mente. The adverb itself never changes for gender or number.
Adjectives in -o switch to -a: rápido → rápida → rapidamente, imediato → imediatamente, direto → diretamente.
Adjectives with one form for both genders just take the suffix: feliz → felizmente, provável → provavelmente, fluente → fluentemente, paciente → pacientemente.
Why do accents vanish? The main stress of the new word falls on -men-, so the old stressed syllable is no longer the main one. The acute and circumflex accents that marked it are dropped: óbvio → obviamente, simultâneo → simultaneamente. You may still hear a light secondary stress on the original syllable (RA-pida-MEN-te), but it is not written.
When you join two or more -mente adverbs with e or ou, careful Portuguese keeps the suffix only on the last one. The earlier ones stay as bare feminine adjectives: clara e pacientemente, rápida e cuidadosamente. Saying claramente e pacientemente is understood, but it sounds heavier.
Ele fala clara e pacientemente.
(He speaks clearly and patiently.)
Only acute and circumflex accents disappear
A tilde stays, as in the rare vãmente (in vain). You will seldom meet this, but do not remove every mark automatically.
Adjectives in -or
Words like anterior and posterior have no separate feminine form, so they take the suffix directly: anteriormente, posteriormente.
The typical mistake is building on the masculine: rapidomente or perfeitomente. Say the feminine adjective first, then add the suffix. The same rule gives words outside this list, such as automaticamente and historicamente.
Summary
To make an adverb, say the feminine adjective and add -mente: lenta → lentamente, feliz → felizmente. Drop any acute or circumflex accent, because the main stress moves to -men- (rápido → rapidamente). When two such adverbs are joined, put -mente only on the last one.