There's a lot you can do to improve the composition of digital photos (or conventional photos which have been digitised) using software like Photoshop, but this is only practical if you take the photo correctly to start with. I tend to compose photos in a way that makes this post-processing easier. I think of enhancing the photo in Photoshop as part of the photographic process, like many photographers still consider their darkroom work as part of the process of conventional photography.
First, I usually turn off enhancement options in the camera (most importantly, image sharpening). I prefer to apply sharpening, etc in an image editing program later. Depending on the camera you are using this may or may not be the best option. Sometimes in-camera enhancement will do a better job than computer software can, because its designed to work with that specific camera, so just do some testing and figure out what works best for you.
The most common changes I do are cropping and straightening. These are only possible if the original photo covers a wider area than what was intended. So zoom out from the intended composition a bit before taking the photo, and use the highest resolution your camera supports so that you still have plenty of pixels for the software to work with.
Have a look at the example at the top of this page to get an idea of how I would do this. The first image shows the original picture, with a crooked horizon, but zoomed out more than usual for that subject. The second image shows the rotated image with the wasted space around the outside. The third image shows the corrected (straight horizon, correctly cropped) image.