"The key to design a poster" vs. "The key to designing a poster"

Solution 1:

The issue here is that the word "to" can be used in a couple of different ways.

The usual way to form the infinitive of a verb is to put the particle "to" in front of it -- but that's not you want to do here (even though I just did it 3 times!).

I want to design a poster. <-- not your situation

A key unlocks a particular lock, and you can use "for" or "to" as a preposition to specify which one:

I can't find the key to my front door.

This has evolved into a semi-idiomatic way of specifying the most important fact about figuring out something complicated, or learning some skill.

A prepositional phrase requires a noun, and one way to get a noun out of a verb is to use a gerund:

The key to designing a good poster is focusing on good composition.

which is the usual way to say what you want to say. (Notice that, for parallel construction, I replaced the infinitive "to focus" with the gerund "focusing".)

You can use an infinitive to say this, but not with "the key", because "to" binds to it instead of the verb. One example:

The best way to design a good poster is to focus on its composition.