Remember to decide a resourcepack hosting method before you start.
I advise you to use self-host which is easier and faster, but you can also use Dropbox and similar\
Configuration file
This is an example block (remember to change myitems namespace to the one you want).
For example I created a file which will contain all my custom blocks.
I created it in the folder: contents/myitems/configs/
I start creating a simple block called red_block in the file blocks.yml.
It's very important to use a non placeable vanilla material. For example PAPER.
If you use a block (like STONE or DIRT) it will result a bit glitchy when placed.
Creating the textures files
To do that you have to put the .png textures file inside the correct folder.
In this case your namespace is myitems so you have to put them in this folder:
contents/myitems/textures/block/
Alternative textures location
Alternatively you can put them in this folder too:
contents/myitems/resourcepack/assets/myitems/textures/block/
Now open blocks.yml file again and add the resource part as I did.
As you can see I set generate: true and I set the textures for the item.
This tells the plugin to generate the 3D model automatically using your texture.
Using different texture for each face
Important: keep the correct cardinal directions order as shown in the example.
Using the same texture for each face
Adding the block placing functionality
You have to add the specific_properties attribute.