First, some things you will need to get the job done are Scissors, carpet seam adhesive, tape, bitter apple spray, and carpet tacks. Now that you have your supplies, remove that baseboards or the carpet edging. Stretch the carpet flat and tack it into place again using the carpet tacks. Then replace the baseboards or edging. Now, run a thin line of carpet seam adhesive under the edge of the
. carpet. Be sure to pull the carpet taut and press down over the adhesive. This is going to hold the edge down better to make it more difficult to pull up in the future. The bitter apple spray (which I'm sure you were wondering about) is for if your frayed carpet is due to pets. Just spray the carpet (it's not at all harmful) and it will dissuade them from pulling at the carpet.