Sure can! Once you’ve replaced the motherboard refit everything into its slot and off you go!
Make sure your parts match specification, don’t be putting DDR3 RAM in DDR4 slots, and make sure you have a Windows 11 supported CPU going back in too.