Am I able to change a Canon 7D camera setting to be able to take photos in square format, or does it have to be done while being edited, as through do this my photo has lost a lot of its quality.
With the updated version 2.x firmware you can shoot with image quality set to RAW, then use the in-camera editing feature to crop to a square and save to jpeg. There should be no loss in quality compared to letting the camera convert the raw data to jpeg when taking the picture.
Editing the raw file using a computer should also allow you to produce a photo with the same quality as as an in-camera jpeg while also allowing you to crop to a square.
does it have to be done while being edited, as through do this my photo has lost a lot of its quality.
This is a sign you have an issue with editing ( possibly the quality setting you are saving edited images with at a guess - it's a common issue ? ). Editing and saving the result should not need to reduce the quality of the image in any visually significant way. In fact the JPEG format is designed to allow quite high compression ratios while leaving the visual impact of data loss barely perceptible even zoomed in.
I would, in general, let the camera use the "natural" aspect ratio for the shot ( which would be 3:2 for a DSLR ) and crop the result later either in camera ( RAW to JPEG ) or in post ( on a computer ). This is useful as you can avoid missing out of potential crops which are better than your intended one when you took the shot. Just because your initial idea was to shoot 1:1 does not mean that e.g. a 5:4 or 3:2 will not be better in hindsight, so give yourself the freedom of deferring that choice.
For similar reasons I also recommend that people "frame loose", so that they don't e.g. unintentionally cut off something they might want in a shot in hindsight, and to allow a little leeway for rotation of the image in post.