Capacitors, even whole power supplies, and whole hard drives for these old things are generally fairly inexpensive. If you can't afford to buy a new PSU (or a recapped one) for your machine in order to troubleshoot this issue, then you should sell or recycle the machine and use a more modern machine which is less likely to have little electrical components failing.
If you're not willing to troubleshoot this issue (and unfortunately for many people starting with their first old Mac, who only have one Mac so far, or who are reducing their collections) this does often involve "buy another Mac" or "buy some spare parts" then I don't see how it'll be possible to make a determination as to which part is failing (presuming it's only one) and suggest a specific course of action.
As IPalindromeI says-- that shenanigans is dead. The hard disk almost certainly needs a replacement, and even if you buy one and find out it is the power supply, having a spare hard drive is never a bad thing.
If you're not willing to troubleshoot this issue (and unfortunately for many people starting with their first old Mac, who only have one Mac so far, or who are reducing their collections) this does often involve "buy another Mac" or "buy some spare parts" then I don't see how it'll be possible to make a determination as to which part is failing (presuming it's only one) and suggest a specific course of action.
As IPalindromeI says-- that shenanigans is dead. The hard disk almost certainly needs a replacement, and even if you buy one and find out it is the power supply, having a spare hard drive is never a bad thing.