I have a question regarding inputs, let's say i have 3 inputs, two of them have 0.015 btc and one has 0.03 btc, let's say i have to send 0.03 btc, my question is are the wallets like electrum smart enough to use the single input or they will use the inputs randomly.
Most wallets treats inputs differently, they are smart enough to figure out which one should they use.
For the reference clients, they use an algorithm to determine it. If the reference client finds an input that matches the intended send plus transaction fees, they will use it. Otherwise, if there isn't such a UXTO that fits, they will attempt to find another set of UXTOs that can match the send amount. Otherwise, they will attempt to pair the UXTO up together till they can find a set of UXTO to use that will spend the least number of UXTOs.
For Electrum, they have the privacy and priority settings. Privacy means that all the inputs will be spent, increasing the privacy and reduces the UXTO bloat. This will result you in having to pay more fees in each transaction since you are using more UXTOs in every transaction. For priority, they sort out the UXTOs and use the oldest UXTOs first.