You can do this with the widget Value Relation. The process is fully explained here.
Example:
Create a point layer with the fields:
- type, text data type
- subtype, text data type
Create a table without geometry with the field:
- type, string
Create another geometryless table with the fields:
- subtype (string)
- fk (integer)
Start editing and add the types you want to the first geometryless table. The fid column will be filled automatically.
Add the subtypes you want to the second geometryless table. In the fk column, match the fid's from the first table.
Doubleclick the point layer - Attribute Forms. Click the type field, Set Widget type: Value Relation, Layer: Your first geometryless table, Value column: type
Click the subtype field. Widget type: Value relation, Layer: second table, key column:fk, Value column: subtype, filter expression: "fk" = current_value( 'type')