There are two routes to this.
a) Tie in a length along the hook shank and let it stick out behind the hook like a long "tail" for about three inches. Dress the fly as normal. Then when finishing the fly and whipping the head bring the length back forward to the head and whip in, pulling taught so that it almost mimics the bend on the hook. For this you can use fairly light nylon. Say the equivalent of 20lbs BS.
Some use a "double" guard with two lengths dressed in so that you have these two loops with the hook bend sandwiched between them.
b) Dress the fly. Then when finishing the fly and whipping the head tie in a length of very stiff nylon - 40lbs BS - with a deliberate bend in it so that it projects downwards just below the the hook point. Almost like a "prong". Whip some of the thread behind it to keep it projecting almost perpendicular to the hook.
These are two distinct methods. The beauty of them is that you can choose either according to what BS nylon you have to hand.
Method a) has the advantage that you can use a lighter nylon BS than method b). It is said by some that this obstructs a "bite" less. Others say that method b) by being well forward of the hook point is better and deflects the weed better.
If you are not happy then cut your 100lb BS and articulate it forward and put a whipping of thread behind it so that you have a weed guard as per method b) finally trimming so that it is just below level of the hook point.
There is a third method to use springy wire which is bent double then whipped in like method b) with the fold of the bend in the wire being whipped in to just touch the top or barb side of the hook point. Acting like the "gate" on a carabiner or snap hook.
Top image method a) bottom image method b) I have used fly line backing so as to better show up.