Optimized Approaches to Malware Detection: A Study of Machine Learning and Deep Learning Techniques