I've been adapting my custom J3 modules into J4 locally in a WAMP environment followed by installing them on a live test site. So far the only change I've had to make is adding the <namespace> to the module .xml files. These are simple extensions which display frontend content. Your mileage may vary depending on how complicated your modules are.
Here are a couple overviews I found while I was prepping my modules
https://www.youtube.com/watch?v=jUc5sMqb22E
https://joomla.digital-peak.com/images/blog/JWC17_Prepare_you_extension_for_Joomla_4.pdf
For J4 Modules you may want to look at these resources
https://docs.joomla.org/Special:MyLanguage/J4.x:Creating_a_Simple_Module https://github.com/ceford/j4xdemos-mod-mydownmsg
I also downloaded J4-compatible modules from the JED and looked through their files to see how they were written
I haven't tried building a component yet but I found these resources
https://docs.joomla.org/J4.x:Developing_an_MVC_Component https://docs.joomla.org/J4_Component_example_-_Mywalks https://blog.astrid-guenther.de/en/der-weg-zu-joomla4-erweiterungen/ https://github.com/ceford/j4xdemos-com-mywalks
Again, downloading and examining some J4-compatible components might provide useful guidance and insight.