You use not only to link two words or phrases that refer to things, actions, or situations. You put not only in front of the first word or group, and but or but also in front of the second one. The second thing is usually more surprising, interesting, or important than the first one.
When you are linking phrases that begin with a verb, you can omit 'but' or 'but also' and use a personal pronoun instead. For example, instead of saying 'Margaret not only came to the party but brought her aunt as well', you can say 'Margaret not only came to the party, she brought her aunt as well'.
For emphasis, you can put not only first, followed by an auxiliary verb or be, then the subject, then the main verb.
Not only must come first when you are linking two clauses which have different subjects.