not the AirTag, you can make it make noise from the phone but no way to do that automatically.
iOS recently added medication tracking.
I think the watch would be more suitable to what you're trying to do, It will have to be charged every day though, The most I can get out of my series 7 is about 36ish hours. (takes about an hour to charge with the new fast charge) The battery on the new 8 ultra is supposed to last longer, others here could speak more to real world usage.
if the watch won't work, a homepod might be an option, you could have it play a certain song when it's time to take medication, Might be a bit harder to ignore than a phone making a noise in the other room.
With iOS 16, iPadOS 17, and watchOS 9, you can add your medications in the Health app to help track and manage the medications, vitamins, and supplements you take.
support.apple.com