If you wish to add text to a post or page that is displayed exactly as you type it, the preformatted block is for you. You can create one by clicking the Block Inserter icon.
In this guide

You can also type /preformatted
and hit the enter key in an empty paragraph block to quickly create one.
Detailed instructions on adding a block can be found here.
The preformatted block shares a lot of similarities with the paragraph block and the code block. Think of it as a hybrid of the two.
Like the paragraph block, the preformatted block is intended primarily to display text. Unlike the paragraph block, though, the preformatted block keeps any spacing or line breaks exactly as they are entered.
Similar to the code block, the preformatted block is displayed in a monospace font, making it easy to keep text perfectly aligned. However, the preformatted block also includes styling and the ability to add hyperlinks (described below) that a code block doesn’t have.
When you click on the block, a toolbar of options will appear above it:

The Preformatted block has the following options in its toolbar:
- Change the block type
- Make the highlighted text bold
- Make the highlighted text italic
- Insert hyperlink
- Text formatting options
- More block options
When you select a block, you will find additional block settings in the right sidebar. If you do not see the sidebar, you may need to click the Settings icon in the top-right corner to bring up the settings. This icon looks like a square with two uneven columns:

The Block Settings include the following: