If that doesn't help, please give more information - what version of MuseScore, what OS, what keyboard, what settings you see in Edit / Preferences / I/O, what precisely goes wrong when following the steps given in the Handbook for using MIDI keyboards to enter notes.
Comments
Midi cable need to be connected input to output, output to input.;
Connect the keyboard and turn it on *before* starting MuseScore.
https://musescore.org/en/handbook/note-input#midi-keyboard
If that doesn't help, please give more information - what version of MuseScore, what OS, what keyboard, what settings you see in Edit / Preferences / I/O, what precisely goes wrong when following the steps given in the Handbook for using MIDI keyboards to enter notes.