Upgrade your codeunit to AL
If you write code for your clients, you probably have modified business central codeunits. The problem is that most of us did not think about the day codeunits are sealed from modification. Here the upgrade path is not simple, my recommendation, Iterate through your code. I followed these two steps for all the functions that needed to be converted to event subscribers.
Step 1, move all your code to functions.
Step 2, review your logic for compatibility with an available integration event.
Say that you currently have code that changes the value of some field in the GenJnlLine before it is posted. From the screenshot below, you see that an OnBeforePostCustomerEntry business event is available. This is where you will call your function. Note, that typically you will find an integration event either in the begining or at the end of a function. You can look for the different events provided and then move your code accordingly.
Starting in BC 2020 wave 1 release, VSCode has a new function "Find Event" that will list all available events, use this tool to identify a possible event and then narrow down your selection.