Open modal window to insert a new element

Hello! I have a problem. I need, inside the register form of a table, to open a window to register a new element of a relation. For example, I am registering a book and the author does not yet exist. I need to open a window and register this author and then update the authors select. How do I do this (I am a beginner)? If it can be with examples, it is better. Thank you.