This is not a teaching forum. Nor do we write your mod for you.
If we answered open ended questions based on random snippets of garbage code like your original question you would just keep coming back for more,
proxying the creation of your mod to us.
Instead, you need to think about what you are trying to do and research around the topic,
e.g. look at where the methods in question are used in vanilla or other mods doing the same thing.
When you have more specific questions that are real road blocks (not I spent 5 minutes trying to do this) you can ask here.
Since your latest question is based on specifics (but not sadly not much research), I will answer them.
There are FriendlyByteBuffer.read/writeUTF() methods for strings. UTF is the java network format of Strings.
NOTE: It has a maximum size of 32K unicode characters. If you want more you need to split the string into multiple strings.
An example can be found in TagNetworkSerialization.NetworkPayload where is serializes a Map<ResourceLocation, IntList> using read/write functions for the respective keys/values.
There will be other examples if you search.