I need help in materials

UV unwrapping is more controllable, but you can also try box mapping which is automatic and good if you carry on extruding etc. In this thread there is a node setup for box mapping 2d textures that works well: