Is there any guide or what should I know to assemble a bicycle from parts instead of buying a complete new one ?
The first thing you need to know is it is almost always cheaper, faster and less work to buy an assembled bike than build it from parts. I have done it successfully, but it takes time, lots of time. Over a year in one case, because I was trying to get the lowest prices I could find. The time was spent looking for deals on certain components then researching if they were compatible with the frame and the other parts I purchased already. If you aren't wrenching on bikes already you will need several hundred dollars in tools. Some of the tools are specialized and have one purpose so unless you build another bike may never be used again.
Other answers have warned you off the idea and this is good advice, building a complete bike up from scratch is not the place to start learning about bike repair.
There are a number of bike build up videos on YouTube that a bit of searching will get you to. These are probably about as close to a complete guide that you will find.
Another point to consider is warranty. A collection of parts won't have anything significant, even if you buy a brand new part and bolt on, its function might be compromised by one of your other parts.
And some regions of the world alter/eliminate warranty period unless the part was installed by a qualified technician.
Compare, some new bikes have a "lifetime" frame warranty. I've seen a Giant replaced completely when a chainstay weld parted after 10 years riding.