I had previously discussed an activity in which children can write a small book that outlines instructions for a task they know how to do (like how to make a grilled cheese sandwich or how to build a Lego car). This is fun for children because it lets them show off their knowledge and is a great example of the purposeful nature of writing. Having your child write in a booklet, rather than on random pieces of paper, makes the product seem like a more serious and substantial work. Your child will be proud of the results.
Another way to get your child excited about a larger project that involves writing is to do an All-About book. It is similar to the How-To book in that children would write in a booklet, and they could show off all of their knowledge with a book about a particular subject of interest. Most children have some topic they are very engaged in, and this project also gives you the opportunity to research more about this topic with your child (go to the library!). If your child loves cars, the All-About book can be about all of the cars they know, and your child can look at books to see how the cars are built, and draw accompanying pictures. There is so much opportunity for your child to develop a strong relationship between books, the act of research, and the process of reporting on that research.
You can also get started by looking up other All-About books in the library, basically any non-fiction book about a particular topic. Point out to your child that these books have a title, a table of contents, and then a series of categories that relate to the topic. Brainstorm with your child all the different things they know about their topic and then have them choose the areas that are most interesting to them in order to do further research. When your child is engaged and in control of a writing project, they are much more motivated to write words and try their best on spelling and letter formation.
With all of these writing projects, the goal is for your child to see the relationship between their writing and the words they will read out in the world. Children want to be like the people they admire, and all of those people are able to write. Showing your child the broader context for why writing is purposeful, as well as how it can be engaging and fun for them on a personal level, is the best way to motivate and provide the opportunity for growth. All of the technical skills, such as spelling and letter formation, will develop over time, but only if your child wants to write.