OK im supposed to identify the part of speech of the word in brackets...A city must be planned [carefully], or people will not want to live in it. I think it is an adverb but im not certain.

Yes, it's an adverb. Almost all words that end in -ly are adverbs. There are few exceptions

An adverb describes a verb and this one describes how they are planning (the verb).

To identify the part of speech of a word, it helps to first understand the function of the word within the sentence. In this case, the word in brackets is "carefully."

To determine the part of speech of "carefully," we need to consider its role in the sentence. In this particular sentence, "carefully" modifies the verb "planned" by describing how the city should be planned. It answers the question of how the city must be planned.

Since "carefully" is modifying a verb by describing how the action is performed, it is functioning as an adverb. Adverbs often describe how, when, where, or to what extent an action is performed. In this case, "carefully" describes how the city must be planned.

So you are correct! In this sentence "carefully" is indeed an adverb.