Can you be more precise? There is no general answer. Which component are you referring to?
I want to read ADC and some variables in code and send it through UART.
There are certain projects available at these links which can provide you an idea for transferring variables and data from ADC to UART via DMA-