How to insert a local image with custom size

add_image_size function has nothing to do with the images that are located in theme root directory.

When you add add_image_size function , we are saying that :

Hey WordPress! Can you please also re-size my uploaded images via WordPress admin to this particular size also hard crop the image if image size is bigger ( since third argument is set to true ).

So whenever we upload images after adding this function WordPress generate this extra size image in addition to default sizes. These generated images are available in /wp-content/uploads/ folder by default unless you have changed the default uploads folder.

So to resize the image you need to upload the image via WP admin panel and look at the uploads folder.

How should I write this with PHP code in my template file?

Generally this is used to get thumbnail attached to a post/page/CPT, like

the_post_thumbnail( 'testtest' );

The above function generates required html for image tag.