If you are using wordpress you can easily find a plugin to generate a sitemap for you
If you code your own script, you can manualy made your own sitemap, or you can make a program to automaticaly generate your sitemap (depend on your script).
the file is normally at the root of your domain. For example you have domain.com, your sitemap should be on domain.com/sitemap.xml
There are 2 types of sitemap, the compressed which is .gz or the uncompress with .xml
Hope it helps.