Yes. You check the source code. If you don't think the developer is trustworthy, check the source code and build it yourself from source.
there are many problems with what you just said.
1) for example Core is in C++ (if i am not mistaken), Electrum is in Python,... and in order to check the source codes you have to know these programming languages, or at least have some knowledge in any programming language to be able to make heads or tails of what is going on.
Yes, but most major software have sufficient documentation and commenting in the code to make it easier to understand. You also don't need to be an expert in every language to understand what is happening, you just need to know one language that is related (e.g. Java is related to C/C++, Python, C#) to be able to read the code. '
2) these are fairly big project so going through the code is going to take a very long time if you are not a veteran programmer and even if you are it still needs a long time.
Not necessarily. Even though a project may be "big", they usually have decent documentation (code comments) to make understanding what each function should do a lot easier. Furthermore, if you have a starting point that you can trust, then you can just check each code commit from that point on which will be much easier to check than to analyze the whole source code.
3) also building from the source code is not recommended for everybody especially when a newbie is asking for it , because they may break something and encounter a lot more problems and there aren't really detailed walkthroughs available to use them to compile the wallet.
How so? Building from source for the major wallets is well documented and very easy to do. There isn't anything you can break without actually changing the code.
the only solution that is left for regular users (which are the majority of bitcoin users) is to trust the developers based on their history and how long their wallet was around.
Or you can have someone who is able to read code audit the code themselves. You do not have to trust the developer, you can have someone else you trust to check the code for you.