If you have the attribute code and the option value id for the data, then we can get the text value for the option by the below code. The below code is for product, you can use the same logic to get the data for other eav resource models like customer, category, etc.