This will be done when you register_post_type :
$args = array(
'rewrite' => array( 'slug' => 'book' ),
);
register_post_type( 'book', $args );
IMPORTANT ! Remember to go to wp-admin options > permalink and click SAVE on that page for the changes to take effect.