How to get values from datalayer using custom Dimensions

I am new to Matomo, I am using Matomo Tag Manager to trigger custom events from my angular project, In one of the docs it is mentioned that “custom variables” are getting deprecated in the feature. So My question is how to use “custom dimensions” to get data from the data layer without using the “custom data-layer variable”. I am getting the following links which are not helping me

Hi @Manoj_Gowda
I don’t really understand your problem.
In MTM, if you want to use an MTM variable as Matomo custom dimension, you just have to configure, in the Matomo Configuration MTM Variable:

In my screenshot, the 1st Matomo custom dimension will receive the env MTM variable…