There are illegal ways to make money, but actually there are far more ways to make money legally and so you should have no trouble in doing this. However, there are some people that make money and do not realise that they are breaking the law when they are doing so. Therefore it is wise to just be aware of this.
So if you make any money outside of normal employment, then you will need to declare that income to the taxman. The only exceptions to this would be lotteries, selling items you already own and cashback. Lotteries are taxed in a very different way, as with all forms of gambling and so if you get income from gambling of any sort then you do not need to declare the gain in income. If you sell things that you already own then you do not have to pay tax on the income. This is because you have already paid tax on them and there have been used by you. However, if you buy things to sell on, even if they are second hand, then you will need to declare it. If you get cashback when you buy an item, through a cashback website then this is not income as it is a discount.
Any other earnings that you make online will need to be declared. Even if you are earning less than the tax threshold, you still need to declare it. You do this by completing a self-assessment tax return, which can be done online. It can seem daunting and complicated, but actually is fairly straight forward. Just answer the questions in turn and it is fine. You will need to have records of your earnings during the tax year, but you should be keeping accounts anyway so this will be easy for you.
If you are unsure as to whether a way of earning money is legal, then do not do it until you are sure. You might be able to find out using a search engine if an activity is legal or not or you could ask around to find out if people that you know will know. It is not worth doing something if you are not sure as you could get into serious trouble.
There are many examples of ways to earn legally. If you are thinking of working online then you could do freelance work; writing, programming, designing, answer surveys, be a virtual assistant, data entry, clicking adverts or playing free lotteries. There are many options available and what you choose will be determined by how much time you have, how much you want to earn and what skills you have. It is worth finding out more about the work, your potential employer and how much you will be paid before you start. There are sadly scams out there and so you want to protect yourself from these. You do not want to do work and then not be paid or pay money to join sites and find that there is no work so you need to be careful. It is wise to never pay out anything and to research the company before taking on any work from them to ensure that you will get paid. You should be able to find reviews and information about work from home jobs on money making websites or forums.