When you do something firmly, you do it with strength or in a secure way, like when you shut a door firmly behind you so your cat can't get out.
You might grab a tennis racket firmly in your hands, gripping it hard, and then firmly smack the ball across the net. You can also act in a firm, or determined way: "I told her firmly that she couldn't borrow my clothes without asking next time." The Latin root of both firmly and firm is firmus, "strong, steadfast, trusty, or stable."