So, you can use the Pythagorean Theorem!
For example, if the base length is 6 and the height of the pyramid is 4, then you can plug them into the Pythagorean Theorem (a squared + b squared = c squared, a and b being the legs of a right triangle and c being the hypotenuse). 1/2 the length of the base would be 6 divided by 2=3. 3 squared + 4 squared = slant height squared. 9+16=slant height squared. 25= slant height squared. Slant height=5 units.
You're welcome!