The best way is to use the ExtensionManagementUtility. To add a custom field in the general-tab i.e. after the title field, you could add this file in:
EXT:theme_extension/Configuration/TCA/overrides/tx_news_domain_model_news.php
<?php
defined('TYPO3') or die();
$fields = [
'my_cool_custom_field' => [
'label' => 'My cool custom field',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
]
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_news_domain_model_news', $fields);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'tx_news_domain_model_news',
'my_cool_custom_field',
'',
'after:title'
);
You have some options to specify, where your field should appear. (before, after, after:palette:mypalette).
Read the docs for more information:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/HowTo/ExtendingTca/Examples/Index.html