Tying the halyard, or flag rope, to a flagpole is a simple matter if the pole has two opposite hooks at the bottom, called a cleat. If not, there's a simple way around the problem. If the halyard isn't securely tied, it can get loose in heavy winds, during which the halyard may be too unwieldy to catch until the winds pass. This could cause your flag to have to weather a storm, which can shorten its life.
Pull the bottom of the halyard loop down so it's taut.
Hold the halyard doubled up. Don't separate the two sides of the loop.
Loop it around the cleat, starting with the part of the halyard level with the cleat. You can either make a figure eight on the cleat or just a simple, circular loop.
Tie the last few inches of the halyard to the portion of the halyard just above the cleat. Use a slip knot. (See Resources below.)
Tie the halyard if there's no cleat by pulling the rope taut, holding the rope to the pole at point P with a finger and wrapping the halyard once counterclockwise horizontally around the pole so the halyard makes a 90-degree turn at point P. Loop the end of the halyard above or below the bend at point P, and run the loop clockwise around the pole so that its tension keeps point P bent at a right angle. Tie a slip knot with the end of the halyard to the taut part of the halyard just above point P.