and after saving as robot.txt upload it to your root folder so that it is visible at http://www.yourwebsite.com/robot.txt
robots.txt is used to guide crawler of the search engine which pages should be crawled or not. You can also put the path of sitemap.xml so that crawler navigate directly that web pages and the process of indexing may become faster.
Simple methood you'll find is google webmaster tool. they have a section that helps you do it and its like baby steps.
No..A robots.txt is used to just guide the robots "WHERE to crawl". A sitemap can be submitted in robots.txt but there is no place to include keywords. Keywords can be submitted in page META data.
If I want to block my site in all search engine so below format is true ??? User-Agent: * Disallow: /
If you use Google Webmasters you can create a robots.txt file for your website in just a few minutes. There are videos for this available.