---

How to use a here documents to write data to a file in bash script

A here document is nothing but I/O redirection that tells the bash shell to read input from the current source until a line containing only delimiter is seen. How do I use a heredoc redirection feature (here documents) to write data to a file in my bash shell scripts?