They have a very easy cancellation policy - you can send in a letter, email, or fax a simple form (available online) or email the director of your "home" YMCA (the Y you joined up with) allowing for 10 days before the next billing date, and they will. The fact that you forgot about it due to life circumstances, while I get is not your choice if the circumstances were quite terrible, but it is 100% not the YMCA's fault either. They even offer a suspension option where your place is held for 1-6 months at $10/month. Again, simple form to send in. It is a shame that during your time away you didn't notice the charge earlier and make a note to take a few minutes to contact them about what to do as I'm sure they would have been quite understanding of difficult circumstances.
Personally, I would go ahead and ask if there is anything they can do for you regarding your membership for the previous 6 months (either offer a discount off the coming months or something), based on the fact that they should be able to see you never used the facilities, but I would not get too upset if they don't offer you anything. It never hurts to ask, and you may get lucky as long as you tell them you understand it was your responsibility and you were just overwhelmed with dealing with the emergency.