How can I extract labels from the raw .bdf file (DEAP dataset)?

Hello,

you first need to extract the events.

For an introduction to classification using MNE, see the respective tutorial at
https://mne.tools/stable/auto_tutorials/machine-learning/plot_sensors_decoding.html