A/C is one of those annoying problems you almost have to pay someone else to fix. There are several flavors of problems, and I couldn't tell from your description. For instance:
1. If you turn on the A/C switch and nothing happens, that's an electrical problem, and usually a fuse, a loose wire or bad switch. Could be as cheap as a buck!
2. If the A/C turns on, but there is little or no cold, you have a coolant leak. In the US, the law requires you pay a certified mechanic to fix this, to prevent venting the remaining coolant. Middle expensive.
3. If the A/C clunks, makes odd noises, etc. , you have a bad compressor, or an animal trapped under your hood. Now we're talking relacement, usually. More expensive.
As far as things to do to prevent this happening again...about all you can do is have it checked imediatly before the weather heats up for the summer. the mechan ic might be able to add a little coolant, cheap. Otherwise, remember that the fans that blow the cool air into the car cost almost nothing to run, compared to the compressor. so turn up the temperature a little and let the breeze blow. also, once the A/C has cooled the car, turn it to "Recirculate" and turn it a little warmer.