If you need to put a search form to show blog post based on the search term, you can use the code I shared. Generally normal search form may show you result from pages and other custom post type. But here I used the form which is used to show only blog posts.
Here is the code:
** based on the theme you are using, the css code i shared may need to be modified. Please do comments if you face any issue.
<style>
input#search {
border: 2px solid lightgrey;
padding: 5px;
border-radius: 10px;
padding-left: 12px !important;
}
form {
float: right;
}
input[type="image"] {
top: 15px;
display: inline-block;
position: relative;
}
input[type="image"] {
top: 4px;
display: inline-block;
position: relative;
left: -35px;
width: 23px;
}
</style>
<form action="/" method="get">
<input type="text" name="s" id="search" value="<?php the_search_query(); ?>" placeholder="Search" />
<input type="image" alt="Search" src="https://allaboutbasic.files.wordpress.com/2021/08/search-2.png" />
<input type="hidden" name="post_type" value="post" />
</form>