I'm a newbie in graphic design. when I do my design in illustrator I create a big artboard usually 800X500px, but I don't use all the size. So what should I do to get an image of exactly of my design. For example I create an artboard size 800X550px after I do my design the size is only 300X300px, so I need to have a png file size 300X300px.
Object > Artboards > Fit to Artwork Bounds
This will resize the artboard to match the size of the art.
Be aware, this command does not "see" effects items which may alter the boundaries of artwork. For example, a fill which has an effect applied to it that makes it move outside its containing path or a stroke aligned to the outside of a path, or a drop shadow. If you have those elements in the artwork you will need to manually resize the artboard. However, using the menu command to first get close, then manually moving necessary artboard edges can be helpful.