I see that you're a new contributor; welcome!
The following should work: Put the PHP that registers the block in the theme's functions.php file. You'll have to write a function that hooks into the init
action and does the following:
- uses wp_register_script() to designate a JavaScript file that will act as the template for your block;
- uses register_block_type() to register your block.
That template file, which you would put in the theme alongside functions.php or in a sub-folder, will use JSX to format your block.
Of course, the details of what you code depend on what you want your block to do. I strongly suggest you go through the official Gutenberg Block Tutorial from WordPress.