The easiest way to do this is through an app like Infinite Options.
If you’d like to make the changes to the code yourself, check out this tutorial: https://help.shopify.com/themes/customization/products/get-customization-information-for-products.
yes its possible with custom product options apps like infinite product options. they are simple and very useful. u can solve this issue with any of these custom product options apps