First-principles study of electronic, magnetic and vibrational properties in two-dimensional materials