There are many different ways to pipe the edges of a cake, depending on the tip used. Be sure it's snug.
Star tips are very versatile.
Now you're ready to fill the bag. In this example we are using a buttercream. Roll over the collar of the bag and place your hand under the cuff. With your free hand, fill the bag with buttercream. Roll back the collar and twist the top, pushing the buttercream into the tip and eliminating any air pockets.