You can also try to do it yourself - a knee kicker (for near edges) is about $20 at economy sources like Harborfreight or Amazon - a manual stretcher about $50. You peel the carpet loose fromthe nail strips around the edges (may require pulling baseboards off in some cases, but usually you can work it out from under without removing baseboard), then from center out stretch the carpet out toward the outside. One things most people (including a lot of installers) don't realize is you have to keep one knee firmly planted at all times or the slack will work back under you. Work from center to edge moving toward the center of the walls, then from center of room laterally to both sides, stretching the carpet out toward the edges as you go. With a carpet with a pattern or texture you have to work perpendicular to the walls - with a random texture or plain carpet you can work radially from the center of the room to the centers of the walls first, then radially from the center till you get to the corners.
On each pass (about 1-2 feet wide) from center to wall, you press down the carpet into the nail strip at the edge to hold it - it also helps to have about 4 cinder blocks or clean concrete pavers (carpet installers commonly use lead weighted bags) to hold the previous pass you have finished so it does not pull back off the nail strips as you push the slack toward it on the adjacent pass. Some installers just cheat and staple it to the nail strip as they work along. Check the web for how-to videos.
The super economy way, which also normally does the job fine without tools in bedroom or hall sized jobs except with heavily woven carpets like berbers, is to just use two people - one handling the edge strip fastening, the other scuffing their feet from center toward outside edge pushing the wrinkles and slack ahead of them - like pushin out wrinkles in a table cloth. Works best with smooth bottom leather shoes that you can skate over the carpet, so you do not lift your feet and lose some of the tension you are putting in it.
BTW- there is nothing wrong with a carpet losing tension over the years - slack occurs at teh nail strip, due to stretching of the carpet backing from walking, stretching (loss of tension) in the backing and warp from carpet cleaning, loss of strength due to wearing of the fabric from dirt being ground into the warp and backing, etc.