There are two options.
Either buy a reputed brand head unit with Android auto / car play enabled. It will cost you more and difficult to find.
Or
Buy a good quality Chinese one with minimum 4GB RAM and 64 GB ROM with Android 10. For Android auto / car play there comes an adapter (wired and wireless) which will be connected to head unit and enable the required Android auto / car play features. It's kind of 3rd party solution but it works.
Another option is You can install HeadunitReloaded Android app on head unit, it enables the Android auto functionality only..no car play.
It's demo version, if you feel comfortable you can purchase full version in only 6$ I think.
Personally I am using Headunit Reloaded app on Android 8 based head unit